Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec/lex] Optional IdentifierStart after string/numeric literal suffix #3646

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions spec/lex.dd
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ $(GNAME IdentifierStart):
$(I Letter)
$(I UniversalAlpha)

$(GNAME IdentifierStartError):
IdentifierStart

$(GNAME IdentifierChar):
$(GLINK IdentifierStart)
$(B 0)
Expand All @@ -282,6 +285,11 @@ Identifiers can be arbitrarily long, and are case sensitive.)

$(IMPLEMENTATION_DEFINED Identifiers starting with $(D __) (two underscores) are reserved.)

$(NOTE *IdentifierStartError* exists to enforce that a $(GLINK StringPostfix)
or numeric literal with a suffix is not immediately followed by an identifier
without whitespace.)


$(H2 $(LNAME2 string_literals, String Literals))

$(GRAMMAR
Expand Down Expand Up @@ -328,9 +336,9 @@ $(GNAME EscapeSequence):
$(B \\) $(GLINK2 entity, NamedCharacterEntity)

$(GNAME StringPostfix):
$(B c)
$(B w)
$(B d)
$(B c) $(GLINK IdentifierStartError)$(OPT)
$(B w) $(GLINK IdentifierStartError)$(OPT)
$(B d) $(GLINK IdentifierStartError)$(OPT)
)

$(H3 $(LNAME2 wysiwyg, Wysiwyg Strings))
Expand Down Expand Up @@ -626,7 +634,7 @@ $(H2 $(LNAME2 integerliteral, Integer Literals))
$(GRAMMAR_LEX
$(GNAME IntegerLiteral):
$(GLINK Integer)
$(GLINK Integer) $(GLINK IntegerSuffix)
$(GLINK Integer) $(GLINK IntegerSuffix) $(GLINK IdentifierStartError)$(OPT)

$(GNAME Integer):
$(GLINK DecimalInteger)
Expand Down Expand Up @@ -842,9 +850,11 @@ $(H2 $(LNAME2 floatliteral, Floating Point Literals))

$(GRAMMAR_LEX
$(GNAME FloatLiteral):
$(GLINK Float) $(GLINK Suffix)$(OPT)
$(GLINK Integer) $(GLINK FloatSuffix) $(GLINK ImaginarySuffix)$(OPT)
$(GLINK Float)
$(GLINK Float) $(GLINK Suffix) $(GLINK IdentifierStartError)$(OPT)
$(GLINK Integer) $(GLINK FloatSuffix) $(GLINK IdentifierStartError)$(OPT)
$(GLINK Integer) $(GLINK RealSuffix)$(OPT) $(GLINK ImaginarySuffix)
$(GLINK Integer) $(GLINK FloatSuffix) $(GLINK ImaginarySuffix)

$(GNAME Float):
$(GLINK DecimalFloat)
Expand Down