Skip to content

Commit 7e89d59

Browse files
tim-dlangdlang-bot
authored andcommitted
Allow the literal 0_ in the grammar
Decimal literals having exactly one zero and some underscores after it are accepted by DMD, but currently not allowed by the grammar. Previously they were allowed by the grammar as octal literals, but they have been removed.
1 parent 5559619 commit 7e89d59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/lex.dd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,14 @@ $(GNAME IntegerSuffix):
638638
$(B UL)
639639

640640
$(GNAME DecimalInteger):
641-
$(B 0)
641+
$(B 0) $(GLINK Underscores)$(OPT)
642642
$(GLINK NonZeroDigit)
643643
$(GLINK NonZeroDigit) $(GLINK DecimalDigitsUS)
644644

645+
$(GNAME Underscores):
646+
$(B _)
647+
$(GLINK Underscores) $(B _)
648+
645649
$(GNAME BinaryInteger):
646650
$(GLINK BinPrefix) $(GLINK BinaryDigitsNoSingleUS)
647651

0 commit comments

Comments
 (0)