rouge icon indicating copy to clipboard operation
rouge copied to clipboard

TOML: keys starting with digits are not recognized properly

Open jaskij opened this issue 5 years ago • 2 comments

Name of the lexer TOML

Code sample

aaa = "a:100"
100 = "a:100"
1a = "a:100"

Code sample on rouge.jneen.net.

Additional context

In the above snippet all three lines have valid keys, but only the first one is recognized properly.

From TOML specification (emphasis mine):

Bare keys may only contain ASCII letters, ASCII digits, underscores, and dashes (A-Za-z0-9_-). Note that bare keys are allowed to be composed of only ASCII digits, e.g. 1234, but are always interpreted as strings.

Note that this is handled properly by the INI lexer.

jaskij avatar Nov 26 '20 14:11 jaskij

This issue has been automatically marked as stale because it has not had any activity for more than a year. It will be closed if no additional activity occurs within the next 14 days. If you would like this issue to remain open, please reply and let us know if the issue is still reproducible.

stale[bot] avatar Jan 03 '22 21:01 stale[bot]

Looking into it.

tancnle avatar Jan 06 '22 06:01 tancnle