Skip to content

Commit 9e0c19d

Browse files
committed
Clarify grammar for decimal-number cannot have leading zeroes.
1 parent 769f938 commit 9e0c19d

File tree

1 file changed

+11
-4
lines changed
  • src/doc/rustc/src/symbol-mangling

1 file changed

+11
-4
lines changed

src/doc/rustc/src/symbol-mangling/v0.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,12 +983,16 @@ the suffixed name has the same semantics as the original.
983983
## Common rules
984984
[decimal-number]: #common-rules
985985
[digit]: #common-rules
986+
[non-zero-digit]: #common-rules
986987
[lower]: #common-rules
987988
[upper]: #common-rules
988989
989-
> [decimal-number] → *[digit]* {*[digit]*}
990+
> [decimal-number] → \
991+
>       `0` \
992+
>    | *[non-zero-digit]* {*[digit]*}
990993
>
991-
> [digit] → `0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9`
994+
> [non-zero-digit] → `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` \
995+
> [digit] → `0` | *[non-zero-digit]*
992996
>
993997
> [lower] → `a` |`b` |`c` |`d` |`e` |`f` |`g` |`h` |`i` |`j` |`k` |`l` |`m` |`n` |`o` |`p` |`q` |`r` |`s` |`t` |`u` |`v` |`w` |`x` |`y` |`z`
994998
>
@@ -1131,11 +1135,14 @@ The following is a summary of all of the productions of the symbol grammar.
11311135
> [vendor-specific-suffix] → (`.` | `$`) *[suffix]* \
11321136
> [suffix] → {*byte*}
11331137
>
1134-
> [decimal-number] → *[digit]* {*[digit]*}
1138+
> [decimal-number] → \
1139+
>       `0` \
1140+
>    | *[non-zero-digit]* {*[digit]*}
11351141
>
11361142
> [base-62-number] → { *[digit]* | *[lower]* | *[upper]* } `_`
11371143
>
1138-
> [digit] → `0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` \
1144+
> [non-zero-digit] → `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` \
1145+
> [digit] → `0` | *[non-zero-digit]* \
11391146
> [lower] → `a` |`b` |`c` |`d` |`e` |`f` |`g` |`h` |`i` |`j` |`k` |`l` |`m` |`n` |`o` |`p` |`q` |`r` |`s` |`t` |`u` |`v` |`w` |`x` |`y` |`z` \
11401147
> [upper] → `A` | `B` | `C` | `D` | `E` | `F` | `G` | `H` | `I` | `J` | `K` | `L` | `M` | `N` | `O` | `P` | `Q` | `R` | `S` | `T` | `U` | `V` | `W` | `X` | `Y` | `Z`
11411148

0 commit comments

Comments
 (0)