Skip to content

Commit

Permalink
Byte literal syntax: add missing quote escapes
Browse files Browse the repository at this point in the history
Current definitions of byte character literals do not allow escaped
single quotes and byte string literals do not allow escape double
quotes. Updated lexical syntax for byte characters and strings to allow
these characters. This is in sync with the implementation.
  • Loading branch information
osa1 committed Oct 31, 2021
1 parent a01d151 commit cd06f11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ r##"foo #"# bar"##; // foo #"# bar

> **<sup>Lexer</sup>**\
> BYTE_LITERAL :\
> &nbsp;&nbsp; `b'` ( ASCII_FOR_CHAR | BYTE_ESCAPE ) `'`
> &nbsp;&nbsp; `b'` ( ASCII_FOR_CHAR | BYTE_ESCAPE | `\'` ) `'`
>
> ASCII_FOR_CHAR :\
> &nbsp;&nbsp; _any ASCII (i.e. 0x00 to 0x7F), except_ `'`, `\`, \\n, \\r or \\t
Expand All @@ -248,7 +248,7 @@ _number literal_.

> **<sup>Lexer</sup>**\
> BYTE_STRING_LITERAL :\
> &nbsp;&nbsp; `b"` ( ASCII_FOR_STRING | BYTE_ESCAPE | STRING_CONTINUE )<sup>\*</sup> `"`
> &nbsp;&nbsp; `b"` ( ASCII_FOR_STRING | BYTE_ESCAPE | STRING_CONTINUE | `\"` )<sup>\*</sup> `"`
>
> ASCII_FOR_STRING :\
> &nbsp;&nbsp; _any ASCII (i.e 0x00 to 0x7F), except_ `"`, `\` _and IsolatedCR_
Expand Down

0 comments on commit cd06f11

Please sign in to comment.