Skip to content

Commit e099b26

Browse files
authored
Merge pull request #2747 from mark-summerfield/patch-2
Minor English improvements + notes below merged-on-behalf-of: Mathias LANG <pro.mathias.lang@gmail.com>
2 parents e3aed68 + 7aeae82 commit e099b26

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

spec/lex.dd

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ $(HEADERNAV_TOC)
66

77
$(P The lexical analysis is independent of the syntax parsing and the semantic
88
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
1010
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
1212
phase of translation.)
1313

1414
$(H2 $(LNAME2 source_text, Source Text))
1515

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:)
1717

1818
$(LIST
19-
ASCII,
19+
ASCII (strictly, 7-bit ASCII),
2020
UTF-8,
2121
UTF-16BE,
2222
UTF-16LE,
@@ -43,10 +43,10 @@ be less than or equal to U+0000007F.)
4343
$(P The source text is decoded from its source representation into Unicode
4444
$(GLINK Character)s. The $(GLINK Character)s are further divided into: $(GLINK
4545
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).)
4747

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
5050
$(D >>) is a right shift token, not two greater than tokens. There are two
5151
exceptions to this rule:)
5252

@@ -355,7 +355,12 @@ $(GNAME TokenString):
355355
$(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
356356

357357
$(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 `"`.
359364
All characters between
360365
the `r"` and `"` are part of the string.
361366
There are no escape sequences inside wysiwyg strings.
@@ -369,8 +374,8 @@ $(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
369374
---
370375

371376
$(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.
374379
)
375380

376381
---
@@ -384,7 +389,7 @@ $(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
384389
$(H3 $(LNAME2 double_quoted_strings, Double Quoted Strings))
385390

386391
$(P Double quoted strings are enclosed by "". $(GLINK EscapeSequence)s can be
387-
embedded into them.)
392+
embedded in them.)
388393

389394
---
390395
"Who are you?"
@@ -439,7 +444,7 @@ q"[foo{]" // "foo{"
439444

440445
$(P If the delimiter is an identifier, the identifier must
441446
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
443448
of the line:
444449
)
445450
---
@@ -492,7 +497,7 @@ $(H3 $(LNAME2 string_postfix, String Postfix))
492497

493498

494499
$(TABLE2 String Literal Postfix Characters,
495-
$(THEAD Postfix, Type, Aka)
500+
$(THEAD Postfix, Type, Alias)
496501
$(TROW $(B c), $(D immutable(char)[]), $(D string))
497502
$(TROW $(B w), $(D immutable(wchar)[]), $(D wstring))
498503
$(TROW $(B d), $(D immutable(dchar)[]), $(D dstring))
@@ -542,7 +547,8 @@ $(H2 $(LNAME2 escape_sequences, Escape Sequences))
542547
$(D \U0001F603) represents the Unicode character U+1F603 (SMILING FACE
543548
WITH OPEN MOUTH).)
544549
$(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).)
546552
)
547553

548554
$(H2 $(LNAME2 characterliteral, Character Literals))
@@ -721,7 +727,7 @@ $(GNAME HexLetter):
721727
by a $(SINGLEQUOTE 0x) or $(SINGLEQUOTE 0X).
722728
)
723729

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.
725731
)
726732

727733
---
@@ -764,9 +770,9 @@ $(GNAME HexLetter):
764770
$(TROW $(D 0x0UL .. 0xFFFF_FFFF_FFFF_FFFFUL), $(D ulong))
765771
)
766772

767-
$(P An integer literal may not exceed those values.)
773+
$(P An integer literal may not exceed these values.)
768774

769-
$(BEST_PRACTICE Octal integer notation is not supported in integer literals.
775+
$(BEST_PRACTICE Octal integer notation is not supported for integer literals.
770776
However, octal integer literals can be interpreted at compile time through
771777
the $(REF octal, std,conv) template, as in $(D octal!167).)
772778

@@ -856,7 +862,7 @@ $(GNAME LeadingDecimal):
856862
the exponent of 2.
857863
)
858864

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.
860866
)
861867

862868
---
@@ -867,10 +873,8 @@ $(GNAME LeadingDecimal):
867873
---
868874

869875
$(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`.
874878
)
875879

876880
$(P If a floating literal is followed by $(B i), then it is an
@@ -1054,7 +1058,7 @@ $(H2 $(LNAME2 specialtokens, Special Tokens))
10541058
$(THEAD Special Token, Replaced with)
10551059

10561060
$(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)
10581062

10591063
$(TROW $(D __TIME__), string literal of the time of compilation "$(I hh:mm:ss)")
10601064
$(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):
10981102
)
10991103

11001104
-----------------
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
11031107
-----------------
11041108

11051109
$(IMPLEMENTATION_DEFINED

0 commit comments

Comments
 (0)