@@ -6,17 +6,17 @@ $(HEADERNAV_TOC)
6
6
7
7
$(P The lexical analysis is independent of the syntax parsing and the semantic
8
8
analysis. The lexical analyzer splits the source text up into tokens. The
9
- lexical grammar describes the syntax of those tokens. The grammar is designed to
9
+ lexical grammar describes the syntax of these tokens. The grammar is designed to
10
10
be suitable for high speed scanning and to make it easy to write a correct
11
- scanner for it . It has a minimum of special case rules and there is only one
11
+ scanner. It has a minimum of special case rules and there is only one
12
12
phase of translation.)
13
13
14
14
$(H2 $(LNAME2 source_text, Source Text))
15
15
16
- $(P Source text can be in one of the following formats :)
16
+ $(P Source text can be in any one of the following encodings :)
17
17
18
18
$(LIST
19
- ASCII,
19
+ ASCII (strictly, 7-bit ASCII) ,
20
20
UTF-8,
21
21
UTF-16BE,
22
22
UTF-16LE,
@@ -43,10 +43,10 @@ be less than or equal to U+0000007F.)
43
43
$(P The source text is decoded from its source representation into Unicode
44
44
$(GLINK Character)s. The $(GLINK Character)s are further divided into: $(GLINK
45
45
WhiteSpace), $(GLINK EndOfLine), $(GLINK Comment)s, $(GLINK
46
- SpecialTokenSequence)s, $(GLINK Token)s, all followed by $(GLINK EndOfFile).)
46
+ SpecialTokenSequence)s, and $(GLINK Token)s, with the source terminated by an $(GLINK EndOfFile).)
47
47
48
- $(P The source text is split into tokens using the maximal munch technique ,
49
- i.e., the lexical analyzer makes the longest token it can . For example
48
+ $(P The source text is split into tokens using the maximal munch algorithm ,
49
+ i.e., the lexical analyzer makes the longest possible token . For example
50
50
$(D >>) is a right shift token, not two greater than tokens. There are two
51
51
exceptions to this rule:)
52
52
@@ -355,7 +355,12 @@ $(GNAME TokenString):
355
355
$(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
356
356
357
357
$(P
358
- Wysiwyg ("what you see is what you get") quoted strings are enclosed by `r"` and `"`.
358
+ Wysiwyg ("what you see is what you get") quoted strings can be defined
359
+ using either of two syntaxes.
360
+ )
361
+
362
+ $(P
363
+ In the first form, they are enclosed between `r"` and `"`.
359
364
All characters between
360
365
the `r"` and `"` are part of the string.
361
366
There are no escape sequences inside wysiwyg strings.
@@ -369,8 +374,8 @@ $(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
369
374
---
370
375
371
376
$(P
372
- An alternate form of wysiwyg strings are enclosed by backquotes,
373
- the $(BACKTICK) character.
377
+ Alternatively, wysiwyg strings can be enclosed by backquotes,
378
+ using the $(BACKTICK) character.
374
379
)
375
380
376
381
---
@@ -384,7 +389,7 @@ $(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
384
389
$(H3 $(LNAME2 double_quoted_strings, Double Quoted Strings))
385
390
386
391
$(P Double quoted strings are enclosed by "". $(GLINK EscapeSequence)s can be
387
- embedded into them.)
392
+ embedded in them.)
388
393
389
394
---
390
395
"Who are you?"
@@ -439,7 +444,7 @@ q"[foo{]" // "foo{"
439
444
440
445
$(P If the delimiter is an identifier, the identifier must
441
446
be immediately followed by a newline, and the matching
442
- delimiter is the same identifier starting at the beginning
447
+ delimiter must be the same identifier starting at the beginning
443
448
of the line:
444
449
)
445
450
---
@@ -492,7 +497,7 @@ $(H3 $(LNAME2 string_postfix, String Postfix))
492
497
493
498
494
499
$(TABLE2 String Literal Postfix Characters,
495
- $(THEAD Postfix, Type, Aka )
500
+ $(THEAD Postfix, Type, Alias )
496
501
$(TROW $(B c), $(D immutable(char)[]), $(D string))
497
502
$(TROW $(B w), $(D immutable(wchar)[]), $(D wstring))
498
503
$(TROW $(B d), $(D immutable(dchar)[]), $(D dstring))
@@ -542,7 +547,8 @@ $(H2 $(LNAME2 escape_sequences, Escape Sequences))
542
547
$(D \U0001F603) represents the Unicode character U+1F603 (SMILING FACE
543
548
WITH OPEN MOUTH).)
544
549
$(TROW $(D \)$(I name), Named character entity from the HTML5
545
- specification. See $(GLINK2 entity, NamedCharacterEntity).)
550
+ specification. These names begin with $(CODE_AMP) and end with $(D ;), e.g., $(CODE_AMP)$D(euro;).
551
+ See $(GLINK2 entity, NamedCharacterEntity).)
546
552
)
547
553
548
554
$(H2 $(LNAME2 characterliteral, Character Literals))
@@ -721,7 +727,7 @@ $(GNAME HexLetter):
721
727
by a $(SINGLEQUOTE 0x) or $(SINGLEQUOTE 0X).
722
728
)
723
729
724
- $(P Integers can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters, which are ignored.
730
+ $(P Integers can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters to improve readability, and which are ignored.
725
731
)
726
732
727
733
---
@@ -764,9 +770,9 @@ $(GNAME HexLetter):
764
770
$(TROW $(D 0x0UL .. 0xFFFF_FFFF_FFFF_FFFFUL), $(D ulong))
765
771
)
766
772
767
- $(P An integer literal may not exceed those values.)
773
+ $(P An integer literal may not exceed these values.)
768
774
769
- $(BEST_PRACTICE Octal integer notation is not supported in integer literals.
775
+ $(BEST_PRACTICE Octal integer notation is not supported for integer literals.
770
776
However, octal integer literals can be interpreted at compile time through
771
777
the $(REF octal, std,conv) template, as in $(D octal!167).)
772
778
@@ -856,7 +862,7 @@ $(GNAME LeadingDecimal):
856
862
the exponent of 2.
857
863
)
858
864
859
- $(P Floating literals can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters, which are ignored.
865
+ $(P Floating literals can have embedded $(SINGLEQUOTE $(UNDERSCORE)) characters to improve readability, and which are ignored.
860
866
)
861
867
862
868
---
@@ -867,10 +873,8 @@ $(GNAME LeadingDecimal):
867
873
---
868
874
869
875
$(P Floating literals with no suffix are of type `double`.
870
- They can be followed by one $(B f), $(B F),
871
- or $(B L) suffix.
872
- The $(B f) or $(B F) suffix types it is a
873
- `float`, and $(B L) types it is a `real`.
876
+ Floating literals followed by $(B f) or $(B F) are of type `float`,
877
+ and those followed by $(B L) are of type `real`.
874
878
)
875
879
876
880
$(P If a floating literal is followed by $(B i), then it is an
@@ -1054,7 +1058,7 @@ $(H2 $(LNAME2 specialtokens, Special Tokens))
1054
1058
$(THEAD Special Token, Replaced with)
1055
1059
1056
1060
$(TROW $(D __DATE__), string literal of the date of compilation "$(I mmm dd yyyy)")
1057
- $(TROW $(D __EOF__), sets the scanner to the end of the file )
1061
+ $(TROW $(D __EOF__), tells the scanner to ignore everything after this token )
1058
1062
1059
1063
$(TROW $(D __TIME__), string literal of the time of compilation "$(I hh:mm:ss)")
1060
1064
$(TROW $(D __TIMESTAMP__), string literal of the date and time of compilation "$(I www mmm dd hh:mm:ss yyyy)")
@@ -1098,8 +1102,8 @@ $(GNAME Filespec):
1098
1102
)
1099
1103
1100
1104
-----------------
1101
- int #line 6 "foo\bar "
1102
- x; // this is now line 6 of file foo\bar
1105
+ int #line 6 "pkg/mod.d "
1106
+ x; // this is now line 6 of file pkg/mod.d
1103
1107
-----------------
1104
1108
1105
1109
$(IMPLEMENTATION_DEFINED
0 commit comments