Skip to content

Commit b5d42ab

Browse files
committed
Update comments for anything not a valid numeric literal
1 parent 25ec361 commit b5d42ab

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

standard/lexical-structure.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -689,21 +689,21 @@ To permit the smallest possible `int` and `long` values to be written as integer
689689
> 123 // decimal, int
690690
> 10_543_765Lu // decimal, ulong
691691
> 1_2__3___4____5 // decimal, int
692-
> _123 // invalid; no leading _ allowed
692+
> _123 // not a numeric literal; identifier due to leading _
693693
> 123_ // invalid; no trailing _allowed
694694
>
695695
> 0xFf // hex, int
696696
> 0X1b_a0_44_fEL // hex, long
697697
> 0x1ade_3FE1_29AaUL // hex, ulong
698698
> 0x_abc // hex, int
699-
> _0x123 // invalid; no leading _ allowed
699+
> _0x123 // not a numeric literal; identifier due to leading _
700700
> 0xabc_ // invalid; no trailing _ allowed
701701
>
702702
> 0b101 // binary, int
703703
> 0B1001_1010u // binary, uint
704704
> 0b1111_1111_0000UL // binary, ulong
705705
> 0B__111 // binary, int
706-
> __0B111 // invalid; no leading _ allowed
706+
> __0B111 // not a numeric literal; identifier due to leading _
707707
> 0B111__ // invalid; no trailing _ allowed
708708
> ```
709709
>
@@ -757,18 +757,18 @@ The value of a real literal of type `float` or `double` is determined by using t
757757
> *Example*:
758758
>
759759
> ```csharp
760-
> 1.234_567 // double
761-
> .3e5f // float
762-
> 2_345E-2_0 // double
763-
> 15D // double
764-
> 19.73M // decimal
765-
> 1.F // invalid; ill-formed (parsed as "1." and "F")
766-
> _1.2F // invalid; no leading _ allowed
767-
> 1_.2F // invalid; no trailing _ allowed in integer part
768-
> 1._234 // invalid; no leading _ allowed in fraction
769-
> 1.234_ // invalid; no trailing _ allowed in fraction
770-
> .3e_5F // invalid; no leading _ allowed in exponent
771-
> .3e5_F // invalid; no trailing _ allowed in exponent
760+
> 1.234_567 // double
761+
> .3e5f // float
762+
> 2_345E-2_0 // double
763+
> 15D // double
764+
> 19.73M // decimal
765+
> 1.F // parsed as a member access of F due to non-digit after .
766+
> _1.2F // invalid; _1 is an identifier due to leading _
767+
> 1_.2F // invalid; no trailing _ allowed in integer part
768+
> 1._234 // parsed as a member access of _234 due to non-digit after .
769+
> 1.234_ // invalid; no trailing _ allowed in fraction
770+
> .3e_5F // invalid; no leading _ allowed in exponent
771+
> .3e5_F // invalid; no trailing _ allowed in exponent
772772
> ```
773773
>
774774
> *end example*

0 commit comments

Comments
 (0)