Skip to content

Commit

Permalink
Adding type.dd to LaTeX gen
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Jan 22, 2013
1 parent f9bf527 commit c9a665b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 47 deletions.
2 changes: 2 additions & 0 deletions doc.ddoc
Expand Up @@ -458,6 +458,7 @@ google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=$0,$0

ET=&
CODE_ET=$(D &)
CODE_PIPE=$(D |)
GT=>
LT=<
REG=&copy;
Expand All @@ -471,3 +472,4 @@ DDOC_COMMENT=<!--$0-->
UNDERSCORE=_
TABLE_2COLS=$(TABLE2 $1, $+)
TROW_EXPLANATORY=<td colspan=10>$0</td>
FOOTNOTE=$(I &nbsp;($0))
6 changes: 6 additions & 0 deletions latex.ddoc
@@ -1,5 +1,6 @@
ET=\&
CODE_ET=$(D &)
CODE_PIPE=\lstinline^|^
GT=>
LT=<
REG=(c)
Expand All @@ -22,6 +23,11 @@ U=\underline{$0}
MIDRULE=\midrule
TROW_EXPLANATORY=$0\\
OPT=\(\mathrm{\sb{opt}}\)
SECTION1=$(H1 $1) $+
SECTION2=$(H2 $1) $+
SECTION3=$(H3 $1) $+
SECTION4=$(H4 $1) $+
FOOTNOTE=\footnote{$0}

DDOC=% Copyright (c) 1999-$(YEAR) by Digital Mars
% All Rights Reserved Written by Walter Bright
Expand Down
2 changes: 1 addition & 1 deletion posix.mak
Expand Up @@ -220,7 +220,7 @@ $(DOC_OUTPUT_DIR)/dlangspec.mobi : \
# 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 module declaration)
dlangspec-tex.d : $(addsuffix .dd,spec lex module declaration type)
rdmd ../tools/catdoc.d -o=$@ $^

dlangspec.tex : $(DDOC) latex.ddoc dlangspec-tex.d
Expand Down
89 changes: 43 additions & 46 deletions type.dd
Expand Up @@ -2,7 +2,7 @@ Ddoc

$(SPEC_S Types,

$(SECTION2 Basic Data Types,
$(SECTION3 Basic Data Types,

$(TABLE2 Basic Data Types,
$(THEAD Keyword, Description, Default Initializer ($(D .init)))
Expand Down Expand Up @@ -78,9 +78,8 @@ $(SECTION2 Basic Data Types,
)
$(TROW
$(D real),
largest hardware implemented floating
point size ($(B Implementation Note:) 80 bits for x86 CPUs)
or double size$(COMMA) whichever is larger,
largest hardware-implemented FP size$(FOOTNOTE $(B Implementation Note:) 80 bits for x86 CPUs
or double size$(COMMA) whichever is larger),
$(D real.nan)
)
$(TROW
Expand Down Expand Up @@ -132,7 +131,7 @@ $(SECTION2 Basic Data Types,
)


$(SECTION2 Derived Data Types,
$(SECTION3 Derived Data Types,

$(UL
$(LI pointer)
Expand All @@ -145,7 +144,7 @@ $(SECTION2 Derived Data Types,
$(P $(DDSUBLINK arrays, strings, $(I Strings)) are a special case of arrays.)
)

$(SECTION2 User Defined Types,
$(SECTION3 User Defined Types,

$(UL
$(LI alias)
Expand All @@ -158,16 +157,16 @@ $(SECTION2 User Defined Types,
)


$(SECTION2 Base Types,
$(SECTION3 Base Types,

$(P The $(I base type) of an enum is the type it is based on:)

---
enum E : T { ... } // T is the $(I base type) of E
enum E : T { ... } // T is the base type of E
---

$(V1
$(P The $(I base type) of a typedef is the type it is formed from:)
$(P The base type of a typedef is the type it is formed from:)

---
typedef T U; // T is the $(I base type) of U
Expand All @@ -176,15 +175,15 @@ typedef T U; // T is the $(I base type) of U
)


$(SECTION2 Pointer Conversions,
$(SECTION3 Pointer Conversions,

$(P Casting pointers to non-pointers and vice versa is allowed in D,
however, do not do this for any pointers that point to data
allocated by the garbage collector.
)
)

$(SECTION2 Implicit Conversions,
$(SECTION3 Implicit Conversions,

$(P Implicit conversions are used to automatically convert
types as required.
Expand Down Expand Up @@ -216,47 +215,44 @@ f = Foo.E; // OK
)


$(SECTION2 Integer Promotions,
$(SECTION3 Integer Promotions,

$(P Integer Promotions are conversions of the following types:
)

$(TABLE2 Integer Promotions,
$(TR
$(TH from)
$(TH to)
)
$(TR
$(TD bool)
$(TD int)
$(THEAD from, to)
$(TROW
$(TD $(D bool)),
$(TD $(D int))
)
$(TR
$(TD byte)
$(TD int)
$(TROW
$(TD $(D byte)),
$(TD $(D int))
)
$(TR
$(TD ubyte)
$(TD int)
$(TROW
$(TD $(D ubyte)),
$(TD $(D int))
)
$(TR
$(TD short)
$(TD int)
$(TROW
$(TD $(D short)),
$(TD $(D int))
)
$(TR
$(TD ushort)
$(TD int)
$(TROW
$(TD $(D ushort)),
$(TD $(D int))
)
$(TR
$(TD char)
$(TD int)
$(TROW
$(TD $(D char)),
$(TD $(D int))
)
$(TR
$(TD wchar)
$(TD int)
$(TROW
$(TD $(D wchar)),
$(TD $(D int))
)
$(TR
$(TD dchar)
$(TD uint)
$(TROW
$(TD $(D dchar)),
$(TD $(D uint))
)
)

Expand All @@ -267,7 +263,7 @@ $(SECTION2 Integer Promotions,
)


$(SECTION2 Usual Arithmetic Conversions,
$(SECTION3 Usual Arithmetic Conversions,

$(P The usual arithmetic conversions convert operands of binary
operators to a common type. The operands must already be
Expand Down Expand Up @@ -344,13 +340,14 @@ ulong u4 = cast(long)-1; // ok, -1 can be represented in a ulong
)


$(SECTION2 bool,
$(SECTION3 $(D bool),

$(P The bool type is a 1 byte size type that can only hold the
value $(D_KEYWORD true) or $(D_KEYWORD false).
The only operators that can accept operands of type bool are:
&amp; | ^ &amp;= |= ^= ! &amp;&amp; || ?:.
A bool value can be implicitly converted to any integral type,
$(CODE_ET) $(CODE_PIPE) $(D ^) $(CODE_ET)$(D =) $(CODE_PIPE)$(D =)
$(D ^=) ! $(CODE_ET)$(CODE_ET) $(CODE_PIPE)$(CODE_PIPE) $(D ?:).
A $(D bool) value can be implicitly converted to any integral type,
with $(D_KEYWORD false) becoming 0 and $(D_KEYWORD true) becoming 1.
The numeric literals 0 and 1 can be implicitly
converted to the bool values $(D_KEYWORD false) and $(D_KEYWORD true),
Expand All @@ -362,7 +359,7 @@ $(SECTION2 bool,
)


$(SECTION2 <a name="delegates">Delegates</a>,
$(SECTION3 $(LNAME2 delegates, Delegates),

$(P There are no pointers-to-members in D, but a more useful
concept called $(I delegates) are supported.
Expand Down Expand Up @@ -435,7 +432,7 @@ mfp(c, 1); // and call c.foo(1)
---
)

$(SECTION2 $(D size_t) And $(D ptrdiff_t),
$(SECTION3 $(D size_t) and $(D ptrdiff_t),

$(P $(D size_t) is an alias to one of the unsigned integral basic types,
and represents a type that is large enough to represent an offset into
Expand Down

0 comments on commit c9a665b

Please sign in to comment.