mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
Fix parsing bug for numbers.
This commit is contained in:
parent
2c1b506213
commit
63137b8107
@ -294,7 +294,7 @@ static int tokenchar(JanetParser *p, JanetParseState *state, uint8_t c) {
|
||||
/* Token finished */
|
||||
blen = (int32_t) p->bufcount;
|
||||
int start_dig = p->buf[0] >= '0' && p->buf[0] <= '9';
|
||||
int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+';
|
||||
int start_num = start_dig || p->buf[0] == '-' || p->buf[0] == '+' || p->buf[0] == '.';
|
||||
if (p->buf[0] == ':') {
|
||||
ret = janet_keywordv(p->buf + 1, blen - 1);
|
||||
} else if (start_num && !janet_scan_number(p->buf, blen, &numval)) {
|
||||
|
Loading…
Reference in New Issue
Block a user