diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-13 21:22:27 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-13 21:22:27 +0200 |
commit | 8271d05a889ad0ca35148847d06e6503ad5c121b (patch) | |
tree | b777887bfa12ced99a5d443300973c5ee3414ee3 /src | |
parent | 31aa24d204d50acf26746408364b7741303d62a8 (diff) | |
download | chawan-8271d05a889ad0ca35148847d06e6503ad5c121b.tar.gz |
toml: fix underscore number separator
Underscores should not be added to repr. Also, was_num should only start as true if the first character is a number, and must be true after the while loop.
Diffstat (limited to 'src')
-rw-r--r-- | src/config/toml.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim index 8d65de79..bcba3d22 100644 --- a/src/config/toml.nim +++ b/src/config/toml.nim @@ -370,7 +370,7 @@ proc consumeNumber(state: var TomlParser, c: char): TomlResult = return state.err("invalid number") repr &= c - var was_num = true + var was_num = repr.len > 0 and repr[0] in AsciiDigit while state.has(): if isDigit(state.peek(0)): repr &= state.consume() |