Skip to content

Commit c1faa76

Browse files
committed
Name common ascii control characters
This removes all backslash escaped characters. This helps to avoid confusing similarities with a literal backslash followed by a character versus the interpreted escaped character.
1 parent 27e1ec9 commit c1faa76

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/comments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ r[comments]
44
r[comments.syntax]
55
> **<sup>Lexer</sup>**\
66
> LINE_COMMENT :\
7-
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~\[`/` `!` `\n`] | `//`) ~`\n`<sup>\*</sup>\
7+
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~\[`/` `!` LF] | `//`) ~LF<sup>\*</sup>\
88
> &nbsp;&nbsp; | `//`
99
>
1010
> BLOCK_COMMENT :\
@@ -14,13 +14,13 @@ r[comments.syntax]
1414
> &nbsp;&nbsp; | `/***/`
1515
>
1616
> INNER_LINE_DOC :\
17-
> &nbsp;&nbsp; `//!` ~\[`\n` CR]<sup>\*</sup>
17+
> &nbsp;&nbsp; `//!` ~\[LF CR]<sup>\*</sup>
1818
>
1919
> INNER_BLOCK_DOC :\
2020
> &nbsp;&nbsp; `/*!` ( _BlockCommentOrDoc_ | ~\[`*/` CR] )<sup>\*</sup> `*/`
2121
>
2222
> OUTER_LINE_DOC :\
23-
> &nbsp;&nbsp; `///` (~`/` ~\[`\n` CR]<sup>\*</sup>)<sup>?</sup>
23+
> &nbsp;&nbsp; `///` (~`/` ~\[LF CR]<sup>\*</sup>)<sup>?</sup>
2424
>
2525
> OUTER_BLOCK_DOC :\
2626
> &nbsp;&nbsp; `/**` (~`*` | _BlockCommentOrDoc_ )

src/notation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ production. See [tokens] for more information.
4040
The following are common definitions used in the grammar.
4141

4242
> **<sup>Lexer</sup>**\
43+
> NUL : U+0000
44+
>
45+
> TAB : U+0009
46+
>
47+
> LF : U+000A
48+
>
4349
> CR : U+000D
4450
4551
[binary operators]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators

src/tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ r[lex.token.literal.char]
133133
r[lex.token.literal.char.syntax]
134134
> **<sup>Lexer</sup>**\
135135
> CHAR_LITERAL :\
136-
> &nbsp;&nbsp; `'` ( ~\[`'` `\` \\n \\r \\t] | QUOTE_ESCAPE | ASCII_ESCAPE | UNICODE_ESCAPE ) `'` SUFFIX<sup>?</sup>
136+
> &nbsp;&nbsp; `'` ( ~\[`'` `\` LF CR TAB] | QUOTE_ESCAPE | ASCII_ESCAPE | UNICODE_ESCAPE ) `'` SUFFIX<sup>?</sup>
137137
>
138138
> QUOTE_ESCAPE :\
139139
> &nbsp;&nbsp; `\'` | `\"`
@@ -165,7 +165,7 @@ r[lex.token.literal.str.syntax]
165165
> &nbsp;&nbsp; )<sup>\*</sup> `"` SUFFIX<sup>?</sup>
166166
>
167167
> STRING_CONTINUE :\
168-
> &nbsp;&nbsp; `\` _followed by_ \\n
168+
> &nbsp;&nbsp; `\` _followed by_ LF
169169
170170
r[lex.token.literal.str.intro]
171171
A _string literal_ is a sequence of any Unicode characters enclosed within two
@@ -262,7 +262,7 @@ r[lex.token.byte.syntax]
262262
> &nbsp;&nbsp; `b'` ( ASCII_FOR_CHAR | BYTE_ESCAPE ) `'` SUFFIX<sup>?</sup>
263263
>
264264
> ASCII_FOR_CHAR :\
265-
> &nbsp;&nbsp; _any ASCII (i.e. 0x00 to 0x7F), except_ `'`, `\`, \\n, \\r or \\t
265+
> &nbsp;&nbsp; _any ASCII (i.e. 0x00 to 0x7F) except_ `'`, `\`, LF, CR, or TAB
266266
>
267267
> BYTE_ESCAPE :\
268268
> &nbsp;&nbsp; &nbsp;&nbsp; `\x` HEX_DIGIT HEX_DIGIT\

0 commit comments

Comments
 (0)