Skip to content

[spec/lex] Tweak integer literal grammar formatting #3759

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

Merged
merged 1 commit into from
Jan 22, 2024
Merged
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
44 changes: 25 additions & 19 deletions spec/lex.dd
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,16 @@ $(GNAME EscapeSequence):
$(B \u) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
$(B \U) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit) $(GLINK HexDigit)
$(B \\) $(GLINK2 entity, NamedCharacterEntity)

$(GNAME OctalDigit):
$(B 0)
$(B 1)
$(B 2)
$(B 3)
$(B 4)
$(B 5)
$(B 6)
$(B 7)
)

$(LONGTABLE_2COLS 0.8, Escape Sequences,
Expand Down Expand Up @@ -636,7 +646,9 @@ $(GNAME IntegerSuffix):
$(B LU)
$(B uL)
$(B UL)
)

$(GRAMMAR_LEX
$(GNAME DecimalInteger):
$(B 0) $(GLINK Underscores)$(OPT)
$(GLINK NonZeroDigit)
Expand All @@ -646,16 +658,6 @@ $(GNAME Underscores):
$(B _)
$(GLINK Underscores) $(B _)

$(GNAME BinaryInteger):
$(GLINK BinPrefix) $(GLINK BinaryDigitsNoSingleUS)

$(GNAME BinPrefix):
$(B 0b)
$(B 0B)

$(GNAME HexadecimalInteger):
$(GLINK HexPrefix) $(GLINK HexDigitsNoSingleUS)

$(GNAME NonZeroDigit):
$(B 1)
$(B 2)
Expand Down Expand Up @@ -689,6 +691,15 @@ $(GNAME DecimalDigit):
$(GNAME DecimalDigitUS):
$(GLINK DecimalDigit)
$(B _)
)

$(GRAMMAR_LEX
$(GNAME BinaryInteger):
$(GLINK BinPrefix) $(GLINK BinaryDigitsNoSingleUS)

$(GNAME BinPrefix):
$(B 0b)
$(B 0B)

$(GNAME BinaryDigitsNoSingleUS):
$(GLINK BinaryDigitsUS)$(OPT) $(GLINK BinaryDigit) $(GLINK BinaryDigitsUS)$(OPT)
Expand All @@ -704,16 +715,11 @@ $(GNAME BinaryDigit):
$(GNAME BinaryDigitUS):
$(GLINK BinaryDigit)
$(B _)
)

$(GNAME OctalDigit):
$(B 0)
$(B 1)
$(B 2)
$(B 3)
$(B 4)
$(B 5)
$(B 6)
$(B 7)
$(GRAMMAR_LEX
$(GNAME HexadecimalInteger):
$(GLINK HexPrefix) $(GLINK HexDigitsNoSingleUS)

$(GNAME HexDigits):
$(GLINK HexDigit)
Expand Down