Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First shot at generating PDF via LaTeX

  • Loading branch information...
commit 1d4203a8dbabe9ecbc1a7f46a0b63b9a2743bfe0 1 parent 6e47a94
@andralex andralex authored
View
3  const3.dd
@@ -314,7 +314,7 @@ $(SECTION2 Immutable Member Functions,
)
---
-struct S {
+struct S {
int x;
void foo() immutable {
@@ -582,7 +582,6 @@ Macros:
NO1=<td class="compNo"><a href="$1">No</a></td>
YES=<td class="compYes">Yes</td>
YES1=<td class="compYes"><a href="$1">Yes</a></td>
- D_CODE = <pre class="d_code2">$0</pre>
CPPCODE2 = <pre class="cppcode2">$0</pre>
ERROR = $(RED $(B error))
COMMA=,
View
17 doc.ddoc
@@ -456,5 +456,18 @@ HTTPS = $(LINK2 https://$1,$2)
LUCKY = $(HTTP
google.com/search?btnI=I%27m+Feeling+Lucky&amp;ie=UTF-8&amp;oe=UTF-8&amp;q=$0,$0)
-FOO=FOO
-
+ET=&amp;
+CODE_ET=$(D &amp;)
+GT=>
+LT=<
+REG=&copy;
+H3=<h3>$0</h3>
+H4=<h4>$0</h4>
+CODE_LCURL=$(D {)
+CODE_RCURL=$(D })
+CODE_PERCENT=$(D %)
+FULL_XREF=<a href="phobos/std_$1.html#$2">$(D std.$1.$2)</a>
+DDOC_COMMENT=<!--$0-->
+UNDERSCORE=_
+TABLE_2COLS=$(TABLE2 $1, $+)
+TROW_EXPLANATORY=<td colspan=10>$0</td>
View
1  intro-to-datetime.dd
@@ -773,7 +773,6 @@ Macros:
CXREF = <a href="phobos/core_$1.html#$2">$(D $2)</a>
FULL_CXREF = <a href="phobos/core_$1.html#$2">$(D core.$1.$2)</a>
XREF = <a href="phobos/std_$1.html#$2">$(D $2)</a>
- FULL_XREF = <a href="phobos/std_$1.html#$2">$(D std.$1.$2)</a>
CORE_TIME=<a href="phobos/core_time.html">$(D core.time)</a>
STD_DATETIME=<a href="phobos/std_datetime.html">$(D std.datetime)</a>
STD_DATE=<a href="phobos/std_date.html">$(D std.date)</a>
View
188 latex.ddoc
@@ -0,0 +1,188 @@
+ET=\&
+CODE_ET=$(D &)
+GT=>
+LT=<
+REG=(c)
+H3=\subsection{$0}
+D=\lstinline|$0|
+LCURL=LCURL
+RCURL=RCURL
+CODE_LCURL=\verb|{|
+CODE_RCURL=\verb|}|
+PERCENT=PERCENT
+CODE_PERCENT=\verb|%|
+FULL_XREF = <a href="phobos/std_$1.html#$2">$(D std.$1.$2)</a>
+FULL_XREF=\href{phobos/std_$1.html#$2}{$(D std.$1.$2)}
+DDOC_COMMENT=% $0
+H4=\subsubsection{$0}
+SINGLEQUOTE=`$0'
+UNDERSCORE=\_
+U=\underline{$0}
+MIDRULE=\midrule
+TROW_EXPLANATORY=$0\\
+
+DDOC=% Copyright (c) 1999-$(YEAR) by Digital Mars
+% All Rights Reserved Written by Walter Bright
+% http://www.digitalmars.com
+
+\documentclass[11pt]{article}
+%\usepackage{color}
+\usepackage[usenames,dvipsnames]{xcolor}
+\usepackage{listings}
+\usepackage{hyperref}
+\usepackage{booktabs}
+\usepackage{alltt}
+\usepackage{tabularx}
+
+\def\commentstyle{%
+ \color{OliveGreen}%
+ \textsl%
+}
+\lstset{language=C++,basicstyle=\ttfamily,escapeinside={/*[}{]*/},commentstyle=\commentstyle,morecomment=[n]{/+}{+/},stringstyle=\color{BrickRed},keywordstyle=\color{NavyBlue}}
+\lstset{morekeywords={@disable, @property,
+ @safe, @system, @trusted, abstract, alias, align, asm, assert,
+ auto, body, bool, break, byte, case, cast, catch, cdouble,
+ cent, cfloat, char, class, const, continue, creal, dchar,
+ debug, default, delegate, delete, deprecated, do, double,
+ else, enum, export, extern, false, final, finally, float, for,
+ foreach, foreach_reverse, function, goto, idouble, if, ifloat,
+ immutable, import, in, inout, int, interface, invariant,
+ ireal, is, lazy, long, mixin, module, new, nothrow, null, out,
+ override, package, pragma, private, protected, public, real,
+ ref, return, scope, shared, short, static, struct, super,
+ switch, synchronized, template, this, throw, true, try,
+ typedef, typeid, typeof, ubyte, ucent, uint, ulong, union,
+ unittest, ushort, version, void, volatile, wchar, while,
+ with,\#!, macro, pure, __FILE__, __LINE__, __gshared,
+ __traits, __vector, __parameters}}
+
+\sloppy
+\begin{document}
+\title{D Programming Language Specification}
+\date{}
+\maketitle
+
+$(BODY)
+\end{document}
+
+GOOGLE_FOOTER=
+GOOGLE_REFERRAL=
+FOOTER=
+TOP=
+NAVIGATION_COMMUNITY=
+NAVIGATION_SPEC=
+NAVIGATION_D=
+BOOKS=
+
+TOCENTRY = $(LI $(LINK2 #$+, $+))
+LAYOUT=
+\section{$2}
+ $3
+
+CODE=\lstinline{$0}
+ASMCODE=\lstinline{$0}
+CCODE=\lstinline{$0}
+CPPCODE=\lstinline{$0}
+GRAMMAR=\begin{alltt}
+$0
+\end{alltt}
+GNAME={\fontshape{sl}\selectfont $0}
+DDOCCODE=\lstinline{$0}
+SCINI=\lstinline{$0}
+CONSOLE=\lstinline{$0}
+MODDEFFILE=\lstinline{$0}
+
+GLINK2=$(GLINK $2)
+DDLINK=$(LINK2 #$2, $3)
+DDSUBLINK=$(LINK2 #$2, $3)
+DPLLINK=$(LINK2 http://dlang.org/$1, $2)
+NOT_EBOOK=
+
+B=\textbf{$0}
+I=\textit{$0}
+U=\underline{$0}
+P= $0 \par
+
+DL=\begin{description}
+$0
+\end{description}
+DT=\item[$0]
+DD=$0
+TABLE=\begin{tabular}[2]{lllllllllll}
+$0
+\end{tabular}
+TABLE_2COLS=\begin{center}
+\begin{tabularx}{\textwidth}[2]{lXl}
+$+
+\bottomrule
+\end{tabularx}
+\end{center}
+TABLE_3COLS=\begin{center}
+\begin{tabularx}{\textwidth}[2]{lXXl}
+$+
+\bottomrule
+\end{tabularx}
+\end{center}
+TABLE2=\begin{center}
+\begin{tabular}[10]{lllllllllll}
+$+
+\bottomrule
+\end{tabular}
+\end{center}
+TR=$0 \\
+TH=$0 &
+TD=$0
+OL=\begin{enumerate}
+$0
+\end{enumerate}
+UL=\begin{itemize}
+$0
+\end{itemize}
+LI=\item $0
+BIG=\large{$0}
+SMALL=\small{$0}
+BR=\newline
+LINK=\url{$0}
+LINK2=\href{$1}{$+}
+RED={\color{red}$0}
+BLUE={\color{blue}$0}
+GREEN={\color{green}$0}
+YELLOW={\color{yellow}$0}
+BLACK={\color{black}$0}
+WHITE={\color{white}$0}
+D_CODE=\begin{lstlisting}
+$0
+\end{lstlisting}
+
+TRANSLATIONS=
+
+RED = {\color{red}$0}
+GREEN = {\color{green}$0}
+BLUE = {\color{blue}$0}
+YELLOW = {\color{yellow}$0}
+ORANGE = {\color{orange}$0}
+BLACK = {\color{black}$0}
+WHITE = {\color{white}$0}
+
+COMMA=,
+THX=& $1 $(THX $+)
+TDX=& $1 $(TDX $+)
+THEAD=\toprule $1 $(THX $+) \\ \midrule
+TROW=$1 $(TDX $+) \\
+LIX=\item{$1} $(LIX $+)
+LIST=\begin{itemize}
+$(LIX $1, $+)
+\end{itemize}
+LNAME2=$+
+
+D_COMMENT=$(GREEN $0)
+D_STRING = $(RED $0)
+D_KEYWORD = $(BLUE $0)
+D_PSYMBOL = $(U $0)
+D_PARAM = $(I $0)
+
+D_COMMENT=$0
+D_STRING=$0
+D_KEYWORD=$0
+D_PSYMBOL = $(U $0)
+D_PARAM = $(I $0)
View
674 lex.dd
@@ -11,7 +11,7 @@ $(SPEC_S Lexical,
for. The tokens are readily recognizable by those familiar with C and
C++.
-<h3>Source Text</h3>
+$(H3 Source Text)
D source text can be in one of the following formats:
@@ -48,7 +48,6 @@ $(SPEC_S Lexical,
$(P The source text is decoded from its source representation
into Unicode $(GLINK Character)s.
The $(GLINK Character)s are further divided into:
-
$(GLINK WhiteSpace),
$(GLINK EndOfLine),
$(GLINK Comment)s,
@@ -60,47 +59,45 @@ $(SPEC_S Lexical,
$(P The source text is split into tokens using the maximal munch
technique, i.e., the
lexical analyzer tries to make the longest token it can. For example
- <code>&gt;&gt;</code> is a right shift token,
- not two greater than tokens. An exception to this rule is that a ..
+ $(D $(GT)$(GT)) is a right shift token,
+ not two greater than tokens. An exception to this rule is that a $(D ..)
embedded inside what looks like two floating point literals, as in
- 1..2, is interpreted as if the .. was separated by a space from the
+ $(D 1..2), is interpreted as if the $(D ..) was separated by a space from the
first integer.
)
-<h3>Character Set</h3>
+$(H3 Character Set)
$(GRAMMAR
-$(GNAME Character)
+$(GNAME Character):
$(I any Unicode character)
)
-<h3>End of File</h3>
+$(H3 End of File)
$(GRAMMAR
$(GNAME EndOfFile):
$(I physical end of the file)
- \u0000
- \u001A
-)
+ $(D \u0000)
+ $(D \u001A))
- The source text is terminated by whichever comes first.
+The source text is terminated by whichever comes first.
-<h3>End of Line</h3>
+$(H3 End of Line)
$(GRAMMAR
$(GNAME EndOfLine):
- \u000D
- \u000A
- \u000D \u000A
- \u2028
- \u2029
- $(GLINK EndOfFile)
-)
+ $(D \u000D)
+ $(D \u000A)
+ $(D \u000D \u000A)
+ $(D \u2028)
+ $(D \u2029)
+ $(GLINK EndOfFile))
There is no backslash line splicing, nor are there any limits
on the length of a line.
-<h3>White Space</h3>
+$(H3 White Space)
$(GRAMMAR
$(GNAME WhiteSpace):
@@ -108,14 +105,14 @@ $(GNAME WhiteSpace):
$(GLINK Space) $(I WhiteSpace)
$(GNAME Space):
- \u0020
- \u0009
- \u000B
- \u000C
+ $(D \u0020)
+ $(D \u0009)
+ $(D \u000B)
+ $(D \u000C)
)
-<h3>$(LNAME2 comment, Comments)</h3>
+$(H3 $(LNAME2 comment, Comments))
$(GRAMMAR
$(GNAME Comment):
@@ -123,10 +120,10 @@ $(GNAME Comment):
$(GLINK LineComment)
$(GLINK NestingBlockComment)
-$(GNAME BlockComment)
+$(GNAME BlockComment):
$(B /*) $(GLINK Characters) $(B */)
-$(GNAME LineComment)
+$(GNAME LineComment):
$(B //) $(GLINK Characters) $(GLINK EndOfLine)
$(GNAME NestingBlockComment):
@@ -142,10 +139,9 @@ $(GNAME NestingBlockCommentCharacter):
$(GNAME Characters):
$(GLINK Character)
- $(GLINK Character) $(I Characters)
-)
+ $(GLINK Character) $(I Characters))
- $(P D has three kinds of comments:)
+ $(P D has three kinds of comments:)
$(OL
$(LI Block comments can span multiple lines, but do not nest.)
@@ -169,10 +165,10 @@ a = /+ /* +/ */ 3; // parses as if 'a = */ 3;'
-------------
Comments cannot be used as token concatenators, for example,
- <code>abc/**/def</code> is two tokens, $(D abc) and $(D def),
+ $(D abc/**/def) is two tokens, $(D abc) and $(D def),
not one $(D abcdef) token.
-<h3>Tokens</h3>
+$(H3 Tokens)
$(GRAMMAR
$(GNAME Token):
@@ -182,72 +178,72 @@ $(GNAME Token):
$(GLINK IntegerLiteral)
$(GLINK FloatLiteral)
$(GLINK Keyword)
- $(B /)
- $(B /=)
- $(B .)
- $(B ..)
- $(B ...)
- $(B &)
- $(B &=)
- $(B &&)
- $(B |)
- $(B |=)
- $(B ||)
- $(B -)
- $(B -=)
- $(B --)
- $(B +)
- $(B +=)
- $(B ++)
- $(B &lt;)
- $(B &lt;=)
- $(B &lt;&lt;)
- $(B &lt;&lt;=)
- $(B &lt;&gt;)
- $(B &lt;&gt;=)
- $(B &gt;)
- $(B &gt;=)
- $(B &gt;&gt;=)
- $(B &gt;&gt;&gt;=)
- $(B &gt;&gt;)
- $(B &gt;&gt;&gt;)
- $(B !)
- $(B !=)
- $(B !&lt;&gt;)
- $(B !&lt;&gt;=)
- $(B !&lt;)
- $(B !&lt;=)
- $(B !&gt;)
- $(B !&gt;=)
- $(B $(LPAREN))
- $(B $(RPAREN))
- $(B [)
- $(B ])
- $(B {)
- $(B })
- $(B ?)
- $(B ,)
- $(B ;)
- $(B :)
- $(B $)
- $(B =)
- $(B ==)
- $(B *)
- $(B *=)
- $(B %)
- $(B %=)
- $(B ^)
- $(B ^=)
- $(V2 $(B ^^))
- $(V2 $(B ^^=))
- $(B ~)
- $(B ~=)
- $(V2 $(B @))
- $(V2 $(B =>))
- $(V2 $(B #))
+ $(D /)
+ $(D /=)
+ $(D .)
+ $(D ..)
+ $(D ...)
+ $(CODE_ET)
+ $(CODE_ET)$(D =)
+ $(CODE_ET)$(CODE_ET)
+ $(D |)
+ $(D |=)
+ $(D ||)
+ $(D -)
+ $(D -=)
+ $(D --)
+ $(D +)
+ $(D +=)
+ $(D ++)
+ $(D $(LT))
+ $(D $(LT)=)
+ $(D $(LT)$(LT))
+ $(D $(LT)$(LT)=)
+ $(D $(LT)$(GT))
+ $(D $(LT)$(GT)=)
+ $(D $(GT))
+ $(D $(GT)=)
+ $(D $(GT)$(GT)=)
+ $(D $(GT)$(GT)$(GT)=)
+ $(D $(GT)$(GT))
+ $(D $(GT)$(GT)$(GT))
+ $(D !)
+ $(D !=)
+ $(D !$(LT)$(GT))
+ $(D !$(LT)$(GT)=)
+ $(D !$(LT))
+ $(D !$(LT)=)
+ $(D !$(GT))
+ $(D !$(GT)=)
+ $(D $(LPAREN))
+ $(D $(RPAREN))
+ $(D [)
+ $(D ])
+ $(CODE_LCURL)
+ $(CODE_RCURL)
+ $(D ?)
+ $(D ,)
+ $(D ;)
+ $(D :)
+ $(D $)
+ $(D =)
+ $(D ==)
+ $(D *)
+ $(D *=)
+ $(CODE_PERCENT)
+ $(CODE_PERCENT)$(D =)
+ $(D ^)
+ $(D ^=)
+ $(V2 $(D ^^))
+ $(V2 $(D ^^=))
+ $(D ~)
+ $(D ~=)
+ $(V2 $(D @))
+ $(V2 $(D =$(GT)))
+ $(V2 $(D #))
)
-<h3>Identifiers</h3>
+$(H3 Identifiers)
$(GRAMMAR
$(GNAME Identifier):
@@ -259,7 +255,7 @@ $(GNAME IdentifierChars):
$(GLINK IdentifierChar) $(I IdentifierChars)
$(GNAME IdentifierStart):
- $(B _)
+ $(D _)
$(I Letter)
$(I UniversalAlpha)
@@ -270,15 +266,15 @@ $(GNAME IdentifierChar):
)
- Identifiers start with a letter, $(B _), or universal alpha,
+ Identifiers start with a letter, $(D _), or universal alpha,
and are followed by any number
- of letters, $(B _), digits, or universal alphas.
+ of letters, $(D _), digits, or universal alphas.
Universal alphas are as defined in ISO/IEC 9899:1999(E) Appendix D.
(This is the C99 Standard.)
Identifiers can be arbitrarily long, and are case sensitive.
- Identifiers starting with $(B __) (two underscores) are reserved.
+ Identifiers starting with $(D __) (two underscores) are reserved.
-<h3>String Literals</h3>
+$(H3 String Literals)
$(GRAMMAR
$(GNAME StringLiteral):
@@ -288,8 +284,7 @@ $(GNAME StringLiteral):
$(V1
$(GLINK EscapeSequence))
$(GLINK HexString)
-$(V2
- $(GLINK DelimitedString)
+ $(V2 $(GLINK DelimitedString)
$(GLINK TokenString))
$(GNAME WysiwygString):
@@ -319,28 +314,28 @@ $(GNAME DoubleQuotedCharacter):
$(GLINK EndOfLine)
$(GNAME EscapeSequence):
- $(B \')
- $(B \")
- $(B \?)
- $(B \\)
- $(B \a)
- $(B \b)
- $(B \f)
- $(B \n)
- $(B \r)
- $(B \t)
- $(B \v)
- $(B \) $(GLINK EndOfFile)
- $(B \x) $(GLINK HexDigit) $(GLINK HexDigit)
- $(B \) $(GLINK OctalDigit)
- $(B \) $(GLINK OctalDigit) $(GLINK OctalDigit)
- $(B \) $(GLINK OctalDigit) $(GLINK OctalDigit) $(GLINK OctalDigit)
- $(B \u) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
- $(B \U) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
- $(B \) $(GLINK2 entity, NamedCharacterEntity)
+ $(D \')
+ $(D \")
+ $(D \?)
+ $(D \\)
+ $(D \a)
+ $(D \b)
+ $(D \f)
+ $(D \n)
+ $(D \r)
+ $(D \t)
+ $(D \v)
+ $(D \) $(GLINK EndOfFile)
+ $(D \x) $(GLINK HexDigit) $(GLINK HexDigit)
+ $(D \) $(GLINK OctalDigit)
+ $(D \) $(GLINK OctalDigit) $(GLINK OctalDigit)
+ $(D \) $(GLINK OctalDigit) $(GLINK OctalDigit) $(GLINK OctalDigit)
+ $(D \u) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
+ $(D \U) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
+ $(D \) $(GLINK2 entity, NamedCharacterEntity)
$(GNAME HexString):
- $(B x") $(GLINK HexStringChars) $(B ") $(GLINK StringPostfix)<sub>opt</sub>
+ $(D x") $(GLINK HexStringChars) $(D ") $(GLINK StringPostfix)<sub>opt</sub>
$(GNAME HexStringChars):
$(GLINK HexStringChar)
@@ -361,7 +356,7 @@ $(GNAME DelimitedString):
$(B q") $(I Delimiter) $(GLINK WysiwygCharacters) $(I MatchingDelimiter) $(B ")
$(GNAME TokenString):
- $(B q{) $(GLINK Token)s $(B })
+ $(D q)$(CODE_LCURL) $(GLINK Token)s $(CODE_RCURL)
)
)
@@ -373,9 +368,9 @@ $(GNAME TokenString):
)
$(P In all string literal forms, an $(GLINK EndOfLine) is regarded as a single
- \n character.)
+ $(D \n) character.)
-<h4>Wysiwyg Strings</h4>
+$(H4 Wysiwyg Strings)
$(P
Wysiwyg "what you see is what you get" quoted strings are enclosed by r" and ".
@@ -406,10 +401,10 @@ r"ab\n" // string is 4 characters,
// 'a', 'b', '\', 'n'
---------------
-<h4>Double Quoted Strings</h4>
+$(H4 Double Quoted Strings)
- Double quoted strings are enclosed by "". Escape sequences can be
- embedded into them with the typical \ notation.
+ $(P Double quoted strings are enclosed by "". Escape sequences can be
+ embedded into them with the typical $(D \) notation.)
---------------
"hello"
@@ -422,34 +417,34 @@ r"ab\n" // string is 4 characters,
---------------
$(V1
-<h4>Escape Strings</h4>
+$(H4 Escape Strings)
$(P Escape strings start with a \ and form an escape character sequence.
Adjacent escape strings are concatenated:
)
$(TABLE1
-$(TROW \n, the linefeed character)
-$(TROW \t, the tab character)
-$(TROW \", the double quote character)
-$(TROW \012, octal)
-$(TROW \x1A, hex)
-$(TROW \u1234, wchar character)
-$(TROW \U00101234, dchar character)
-$(TROW \&amp;reg;, &reg; dchar character)
-$(TROW \r\n, carriage return, line feed)
+$(TROW $(D \n), the linefeed character)
+$(TROW $(D \t), the tab character)
+$(TROW $(D \"), the double quote character)
+$(TROW $(D \012), octal)
+$(TROW $(D \x1A), hex)
+$(TROW $(D \u1234), wchar character)
+$(TROW $(D \U00101234), dchar character)
+$(TROW $(D \$(ET)reg;), $(REG); dchar character)
+$(TROW $(D \r\n), carriage return, line feed)
)
$(P Undefined escape sequences are errors.
Although string literals are defined to be composed of
UTF characters, the octal and hex escape sequences allow
the insertion of arbitrary binary data.
- \u and \U escape sequences can only be used to insert
+ $(D \u) and $(D \U) escape sequences can only be used to insert
valid UTF characters.
)
)
-<h4>Hex Strings</h4>
+$(H4 Hex Strings)
$(P Hex strings allow string literals to be created using hex data.
The hex data need not form valid UTF characters.
@@ -521,7 +516,7 @@ $(V2
cannot always be detected, but cause undefined behavior.)
$(V2
-<h4>Delimited Strings</h4>
+$(H4 Delimited Strings)
$(P Delimited strings use various forms of delimiters.
The delimiter, whether a character or identifer,
@@ -534,10 +529,10 @@ $(V2
$(TABLE2 Nesting Delimiters,
$(THEAD Delimiter, Matching Delimiter)
- $(TROW [, ])
+ $(TROW $(D [), $(D ]))
$(TROW $(LPAREN), $(RPAREN))
- $(TROW &lt;, &gt;)
- $(TROW {, })
+ $(TROW $(D $(LT)), $(D $(GT)))
+ $(TROW $(CODE_LCURL), $(CODE_RCURL))
)
---
@@ -572,11 +567,11 @@ q"/foo]/" // "foo]"
// q"/abc/def/" // error
---
-<h4>Token Strings</h4>
+$(H4 Token Strings)
- $(P Token strings open with the characters $(B q{) and close with
- the token $(B }). In between must be valid D tokens.
- The $(B {) and $(B }) tokens nest.
+ $(P Token strings open with the characters $(D q)$(CODE_LCURL) and close with
+ the token $(CODE_RCURL). In between must be valid D tokens.
+ The $(CODE_LCURL) and $(CODE_RCURL) tokens nest.
The string is formed of all the characters between the opening
and closing of the token string, including comments.
)
@@ -585,13 +580,15 @@ q"/foo]/" // "foo]"
q{foo} // "foo"
q{/*}*/ } // "/*}*/ "
q{ foo(q{hello}); } // " foo(q{hello}); "
-q{ __TIME__ } // " __TIME__ ", i.e. it is not replaced with the time
-// q{ __EOF__ } // error, as __EOF__ is not a token, it's end of file
+q{ __TIME__ } // " __TIME__ "
+ // i.e. it is not replaced with the time
+// q{ __EOF__ } // error
+ // __EOF__ is not a token, it's end of file
---
)
-<h3>$(LNAME2 characterliteral, Character Literals)</h3>
+$(H3 $(LNAME2 characterliteral, Character Literals))
$(GRAMMAR
$(GNAME CharacterLiteral):
@@ -603,9 +600,9 @@ $(GNAME SingleQuotedCharacter):
)
Character literals are a single character or escape sequence
- enclosed by single quotes, ' '.
+ enclosed by single quotes, $(D ' ').
-<h3>$(LNAME2 integerliteral, Integer Literals)</h3>
+$(H3 $(LNAME2 integerliteral, Integer Literals))
$(GRAMMAR
$(GNAME IntegerLiteral):
@@ -679,7 +676,7 @@ $(GNAME DecimalDigit):
$(GNAME DecimalDigitUS):
$(GLINK DecimalDigit)
- $(B _)
+ $(D _)
$(GNAME BinaryDigitsUS):
$(GLINK BinaryDigitUS)
@@ -691,7 +688,7 @@ $(GNAME BinaryDigit):
$(GNAME BinaryDigitUS):
$(GLINK BinaryDigit)
- $(B _)
+ $(D _)
$(GNAME OctalDigits):
$(GLINK OctalDigit)
@@ -713,7 +710,7 @@ $(GNAME OctalDigit):
$(GNAME OctalDigitUS):
$(GLINK OctalDigit)
- $(B _)
+ $(D _)
$(GNAME HexDigits):
$(GLINK HexDigit)
@@ -745,7 +742,7 @@ $(GNAME HexLetter):
$(B D)
$(B E)
$(B F)
- $(B _)
+ $(D _)
)
$(P Integers can be specified in decimal, binary, octal, or hexadecimal.)
@@ -767,8 +764,8 @@ $(GNAME HexLetter):
by a $(SINGLEQUOTE 0x).
)
- $(P Integers can have embedded $(SINGLEQUOTE _) characters, which are ignored.
- The embedded $(SINGLEQUOTE _) are useful for formatting long literals, such
+ $(P Integers can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters, which are ignored.
+ The embedded $(SINGLEQUOTE $(UNDERSCORE)) are useful for formatting long literals, such
as using them as a thousands separator:
)
@@ -785,42 +782,37 @@ $(GNAME HexLetter):
$(P The type of the integer is resolved as follows:)
$(TABLE2 Decimal Literal Types,
-
- $(THEAD Decimal Literal, Type)
- $(TROW 0 .. 2_147_483_647, int)
- $(TROW 2_147_483_648 .. 9_223_372_036_854_775_807L, long)
-
- $(THEAD $(ARGS Decimal Literal, L Suffix), Type)
- $(TROW 0L .. 9_223_372_036_854_775_807L, long)
-
- $(THEAD $(ARGS Decimal Literal, U Suffix), Type)
- $(TROW 0U .. 4_294_967_296U, uint)
- $(TROW 4_294_967_296U .. 18_446_744_073_709_551_615UL, ulong)
-
- $(THEAD $(ARGS Decimal Literal, UL Suffix), Type)
- $(TROW 0UL .. 18_446_744_073_709_551_615UL, ulong)
-
- $(THEAD Non-Decimal Literal, Type)
- $(TROW 0x0 .. 0x7FFF_FFFF, int)
- $(TROW 0x8000_0000 .. 0xFFFF_FFFF, uint)
- $(TROW 0x1_0000_0000 .. 0x7FFF_FFFF_FFFF_FFFF, long)
- $(TROW 0x8000_0000_0000_0000 .. 0xFFFF_FFFF_FFFF_FFFF, ulong)
-
- $(THEAD $(ARGS Non-Decimal Literal, L Suffix), Type)
- $(TROW 0x0L .. 0x7FFF_FFFF_FFFF_FFFFL, long)
- $(TROW 0x8000_0000_0000_0000L .. 0xFFFF_FFFF_FFFF_FFFFL, ulong)
-
- $(THEAD $(ARGS Non-Decimal Literal, U Suffix), Type)
- $(TROW 0x0U .. 0xFFFF_FFFFU, uint)
- $(TROW 0x1_0000_0000UL .. 0xFFFF_FFFF_FFFF_FFFFUL, ulong)
-
- $(THEAD $(ARGS Non-Decimal Literal, UL Suffix), Type)
- $(TROW 0x0UL .. 0xFFFF_FFFF_FFFF_FFFFUL, ulong)
-
+ $(THEAD Literal, Type)
+ $(TROW_EXPLANATORY $(I Usual decimal notation))
+ $(TROW $(D 0 .. 2_147_483_647), $(D int))
+ $(TROW $(D 2_147_483_648 .. 9_223_372_036_854_775_807), $(D long))
+ $(MIDRULE)
+ $(TROW_EXPLANATORY $(I Explicit suffixes))
+ $(TROW $(D 0L .. 9_223_372_036_854_775_807L), $(D long))
+ $(TROW $(D 0U .. 4_294_967_296U), $(D uint))
+ $(TROW $(D 4_294_967_296U .. 18_446_744_073_709_551_615U), $(D
+ ulong))
+ $(TROW $(D 0UL .. 18_446_744_073_709_551_615UL), $(D ulong))
+ $(MIDRULE)
+ $(TROW_EXPLANATORY $(I Hexadecimal notation))
+ $(TROW $(D 0x0 .. 0x7FFF_FFFF), $(D int))
+ $(TROW $(D 0x8000_0000 .. 0xFFFF_FFFF), $(D uint))
+ $(TROW $(D 0x1_0000_0000 .. 0x7FFF_FFFF_FFFF_FFFF), $(D long))
+ $(TROW $(D 0x8000_0000_0000_0000 .. 0xFFFF_FFFF_FFFF_FFFF), $(D
+ ulong))
+ $(MIDRULE)
+ $(TROW_EXPLANATORY $(I Hexadecimal notation with explicit suffixes))
+ $(TROW $(D 0x0L .. 0x7FFF_FFFF_FFFF_FFFFL), $(D long))
+ $(TROW $(D 0x8000_0000_0000_0000L .. 0xFFFF_FFFF_FFFF_FFFFL), $(D
+ ulong))
+ $(TROW $(D 0x0U .. 0xFFFF_FFFFU), $(D uint))
+ $(TROW $(D 0x1_0000_0000U .. 0xFFFF_FFFF_FFFF_FFFFU), $(D
+ ulong))
+ $(TROW $(D 0x0UL .. 0xFFFF_FFFF_FFFF_FFFFUL), $(D ulong))
)
-<h3>$(LNAME2 floatliteral, Floating Literals)</h3>
+$(H3 $(LNAME2 floatliteral, Floating Literals))
$(GRAMMAR
$(GNAME FloatLiteral):
@@ -904,8 +896,8 @@ $(GNAME LeadingDecimal):
of 2.
)
- $(P Floating literals can have embedded $(SINGLEQUOTE _) characters, which are ignored.
- The embedded $(SINGLEQUOTE _) are useful for formatting long literals to
+ $(P Floating literals can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters, which are ignored.
+ The embedded $(SINGLEQUOTE $(UNDERSCORE)) are useful for formatting long literals to
make them more readable, such
as using them as a thousands separator:
)
@@ -951,175 +943,169 @@ $(GNAME LeadingDecimal):
4.5 + 6.2i // complex number (phased out)
---------
-<h3>Keywords</h3>
+$(H3 Keywords)
Keywords are reserved identifiers.
$(GRAMMAR
$(GNAME Keyword):
- $(B abstract)
- $(B alias)
- $(B align)
- $(B asm)
- $(B assert)
- $(B auto)
-
- $(B body)
- $(B bool)
- $(B break)
- $(B byte)
-
- $(B case)
- $(B cast)
- $(B catch)
- $(B cdouble)
- $(B cent)
- $(B cfloat)
- $(B char)
- $(B class)
- $(B const)
- $(B continue)
- $(B creal)
-
- $(B dchar)
- $(B debug)
- $(B default)
- $(B delegate)
- $(B delete)
- $(B deprecated)
- $(B do)
- $(B double)
-
- $(B else)
- $(B enum)
- $(B export)
- $(B extern)
-
- $(B false)
- $(B final)
- $(B finally)
- $(B float)
- $(B for)
- $(B foreach)
- $(B foreach_reverse)
- $(B function)
-
- $(B goto)
-
- $(B idouble)
- $(B if)
- $(B ifloat)
-$(V2
- $(B immutable)
-) $(B import)
- $(B in)
- $(B inout)
- $(B int)
- $(B interface)
- $(B invariant)
- $(B ireal)
- $(B is)
-
- $(B lazy)
- $(B long)
-
- $(B macro)
- $(B mixin)
- $(B module)
-
- $(B new)
-$(V2
- $(B nothrow)
-) $(B null)
-
- $(B out)
- $(B override)
-
- $(B package)
- $(B pragma)
- $(B private)
- $(B protected)
- $(B public)
-$(V2
- $(B pure)
+ $(D abstract)
+ $(D alias)
+ $(D align)
+ $(D asm)
+ $(D assert)
+ $(D auto)
+
+ $(D body)
+ $(D bool)
+ $(D break)
+ $(D byte)
+
+ $(D case)
+ $(D cast)
+ $(D catch)
+ $(D cdouble)
+ $(D cent)
+ $(D cfloat)
+ $(D char)
+ $(D class)
+ $(D const)
+ $(D continue)
+ $(D creal)
+
+ $(D dchar)
+ $(D debug)
+ $(D default)
+ $(D delegate)
+ $(D delete)
+ $(D deprecated)
+ $(D do)
+ $(D double)
+
+ $(D else)
+ $(D enum)
+ $(D export)
+ $(D extern)
+
+ $(D false)
+ $(D final)
+ $(D finally)
+ $(D float)
+ $(D for)
+ $(D foreach)
+ $(D foreach_reverse)
+ $(D function)
+
+ $(D goto)
+
+ $(D idouble)
+ $(D if)
+ $(D ifloat)
+ $(V2 $(D immutable))
+ $(D import)
+ $(D in)
+ $(D inout)
+ $(D int)
+ $(D interface)
+ $(D invariant)
+ $(D ireal)
+ $(D is)
+
+ $(D lazy)
+ $(D long)
+
+ $(D macro)
+ $(D mixin)
+ $(D module)
+
+ $(D new)
+ $(V2 $(D nothrow))
+ $(D null)
+
+ $(D out)
+ $(D override)
+
+ $(D package)
+ $(D pragma)
+ $(D private)
+ $(D protected)
+ $(D public)
+ $(V2 $(D pure))
+ $(D real)
+ $(D ref)
+ $(D return)
+
+ $(D scope)
+ $(V2 $(D shared))
+ $(D short)
+ $(D static)
+ $(D struct)
+ $(D super)
+ $(D switch)
+ $(D synchronized)
+
+ $(D template)
+ $(D this)
+ $(D throw)
+ $(D true)
+ $(D try)
+ $(D typedef)
+ $(D typeid)
+ $(D typeof)
+
+ $(D ubyte)
+ $(D ucent)
+ $(D uint)
+ $(D ulong)
+ $(D union)
+ $(D unittest)
+ $(D ushort)
+
+ $(D version)
+ $(D void)
+ $(D volatile)
+
+ $(D wchar)
+ $(D while)
+ $(D with)
+
+ $(V2 $(D __FILE__)
+ $(D __LINE__)
+ $(D __gshared)
+ $(D __traits)
+ $(D __vector)
+ $(D __parameters))
)
- $(B real)
- $(B ref)
- $(B return)
- $(B scope)
-$(V2
- $(B shared)
-) $(B short)
- $(B static)
- $(B struct)
- $(B super)
- $(B switch)
- $(B synchronized)
-
- $(B template)
- $(B this)
- $(B throw)
- $(B true)
- $(B try)
- $(B typedef)
- $(B typeid)
- $(B typeof)
-
- $(B ubyte)
- $(B ucent)
- $(B uint)
- $(B ulong)
- $(B union)
- $(B unittest)
- $(B ushort)
-
- $(B version)
- $(B void)
- $(B volatile)
-
- $(B wchar)
- $(B while)
- $(B with)
-
-$(V2
- $(B __FILE__)
- $(B __LINE__)
- $(B __gshared)
- $(B __traits)
- $(B __vector)
- $(B __parameters))
-)
-
-<h3>$(LNAME2 specialtokens, Special Tokens)</h3>
+$(H3 $(LNAME2 specialtokens, Special Tokens))
$(P
These tokens are replaced with other tokens according to the following
table:
)
- $(TABLE2 Special Tokens,
- $(THEAD Special Token, Replaced with...)
+ $(TABLE_2COLS Special Tokens,
+ $(THEAD Special Token, Replaced with)
$(V1
- $(TROW $(CODE __FILE__), string literal containing source file name)
- $(TROW $(CODE __LINE__), integer literal of the current source line number)
+ $(TROW $(D __FILE__), string literal containing source file name)
+ $(TROW $(D __LINE__), integer literal of the current source line number)
)
- $(TROW $(CODE __DATE__), string literal of the date of compilation "$(I mmm dd yyyy)")
+ $(TROW $(D __DATE__), string literal of the date of compilation "$(I mmm dd yyyy)")
$(V2
- $(TROW $(CODE __EOF__), sets the scanner to the end of the file)
+ $(TROW $(D __EOF__), sets the scanner to the end of the file)
)
- $(TROW $(CODE __TIME__), string literal of the time of compilation "$(I hh:mm:ss)")
- $(TROW $(CODE __TIMESTAMP__), string literal of the date and time of compilation "$(I www mmm dd hh:mm:ss yyyy)")
- $(TROW $(CODE __VENDOR__), $(ARGS Compiler vendor string, such as "Digital Mars D"))
- $(TROW $(CODE __VERSION__), $(ARGS Compiler version as an integer, such as 2001))
+ $(TROW $(D __TIME__), string literal of the time of compilation "$(I hh:mm:ss)")
+ $(TROW $(D __TIMESTAMP__), string literal of the date and time of compilation "$(I www mmm dd hh:mm:ss yyyy)")
+ $(TROW $(D __VENDOR__), $(ARGS Compiler vendor string, such as "Digital Mars D"))
+ $(TROW $(D __VERSION__), $(ARGS Compiler version as an integer, such as 2001))
)
-<h3>$(LNAME2 Special Token Sequence, Special Token Sequences)</h3>
+$(H3 $(LNAME2 Special Token Sequence, Special Token Sequences))
$(GRAMMAR
$(GNAME SpecialTokenSequence):
- $(B # line) $(GLINK IntegerLiteral) $(GLINK EndOfLine)
- $(B # line) $(GLINK IntegerLiteral) $(GLINK Filespec) $(GLINK EndOfLine)
+ $(D # line) $(GLINK IntegerLiteral) $(GLINK EndOfLine)
+ $(D # line) $(GLINK IntegerLiteral) $(GLINK Filespec) $(GLINK EndOfLine)
$(GNAME Filespec):
$(B ") $(GLINK Characters) $(B ")
@@ -1159,5 +1145,3 @@ Macros:
WIKI=Lex
CATEGORY_SPEC=$0
- FULL_XREF = <a href="phobos/std_$1.html#$2">$(D std.$1.$2)</a>
-
View
32 posix.mak
@@ -18,8 +18,14 @@ DOC_OUTPUT_DIR=$(ROOT_DIR)/web
GIT_HOME=git@github.com:D-Programming-Language
# Latest released version
-LATEST:=$(shell cd ${DMD_DIR} && git fetch --tags git@github.com:D-Programming-Language/dmd && \
-git tag | grep '^v[0-9]\.[0-9]*$$' | sed 's/^v//' | sort -nr | head -n 1)
+ifeq (,${LATEST})
+LATEST:=$(shell cd ${DMD_DIR} && \
+ git fetch --tags git@github.com:D-Programming-Language/dmd && \
+ git tag | grep '^v[0-9]\.[0-9]*$$' | sed 's/^v//' | sort -nr | head -n 1)
+endif
+ifeq (,${LATEST})
+ $(error Could not fetch latest version)
+endif
$(info Current release: ${LATEST})
ROOT_DIR=$(shell pwd)
@@ -153,7 +159,8 @@ ${LATEST}.ddoc :
echo "LATEST=${LATEST}" >$@
clean:
- rm -rf $(DOC_OUTPUT_DIR) ${LATEST}.ddoc dlangspec.d dlangspec.html
+ rm -rf $(DOC_OUTPUT_DIR) ${LATEST}.ddoc
+ rm -rf auto dlangspec-tex.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex)
@echo You should issue manually: rm -rf ${DMD_DIR}.${LATEST} ${DRUNTIME_DIR}.${LATEST} ${PHOBOS_DIR}.${LATEST}
rsync : all
@@ -207,6 +214,25 @@ $(DOC_OUTPUT_DIR)/dlangspec.mobi : \
mv dlangspec.mobi $@
################################################################################
+# LaTeX
+################################################################################
+
+# This should be:
+#dlangspec-tex.d : $(addsuffix .dd,$(SPEC_ROOT))
+# However, for now we only produce a subset of files.
+dlangspec-tex.d : $(addsuffix .dd,spec lex)
+ rdmd ../tools/catdoc.d -o=$@ $^
+
+dlangspec.tex : $(DDOC) latex.ddoc dlangspec-tex.d
+ $(DMD) -Df$@ $^
+
+dlangspec.dvi : dlangspec.tex
+ latex $^
+
+dlangspec.pdf : dlangspec.dvi
+ dvipdf $^ $@
+
+################################################################################
# dmd compiler, latest released build and current build
################################################################################
View
2  spec.dd
@@ -24,7 +24,7 @@ $(SPEC_S Table of Contents,
$(TOCENTRY statement, Statements)
$(TOCENTRY arrays, Arrays)
$(TOCENTRY hash-map, Associative Arrays)
- $(TOCENTRY struct, Structs &amp; Unions)
+ $(TOCENTRY struct, Structs $(ET) Unions)
$(TOCENTRY class, Classes)
$(TOCENTRY interface, Interfaces)
$(TOCENTRY enum, Enums)
View
2  struct.dd
@@ -1,6 +1,6 @@
Ddoc
-$(SPEC_S Structs &amp; Unions,
+$(SPEC_S Structs $(ET) Unions,
$(P Whereas classes are reference types, structs are value types.
Any C struct can be exactly represented as a D struct, except non-static

0 comments on commit 1d4203a

Please sign in to comment.
Something went wrong with that request. Please try again.