Commit 363d45c
Reject decimal points after hex float literals (#60199)
Hex float literals like `0x1p3 `should not be allowed to be followed by
decimal digits or decimal points, as this creates confusing implicit
multiplication that looks like a malformed literal. This change makes
the parser reject expressions like 0x1p3.2 (previously parsed as 0x1p3 *
0.2) as invalid numeric constants, consistent with the existing
restriction on juxtaposing hex integer literals.
Fixes #60189. Written by Claude (obviously - since it's set as the
author - trying out the new web thing).
I figure this situation is rare enough and bad enough that we should
just change this unconditionally across syntax versions, but if
preferred, we could make use of syntax evolution for this (although we'd
have to start versioning the lexer).
Co-authored-by: Claude <[email protected]>1 parent 22cfa2b commit 363d45c
File tree
3 files changed
+15
-0
lines changed- JuliaSyntax
- src/julia
- test
- test
3 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1060 | 1068 | | |
1061 | 1069 | | |
1062 | 1070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1684 | 1684 | | |
1685 | 1685 | | |
1686 | 1686 | | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
1687 | 1690 | | |
1688 | 1691 | | |
1689 | 1692 | | |
| |||
0 commit comments