diff options
| author | Karl Zylinski <karl@zylinski.se> | 2023-04-05 22:37:05 +0200 |
|---|---|---|
| committer | Karl Zylinski <karl@zylinski.se> | 2023-04-05 22:37:05 +0200 |
| commit | d7cc166eabe29be751367640a7dbe88b9bf0d095 (patch) | |
| tree | 6ae6e6440106f464708c63ad3fd3a5f17432b6f2 /core/encoding | |
| parent | eef44425c3a39f620b18956ee33ea915ac89223e (diff) | |
Fix for skip_alphanum in JSON tokenizer not checking if first character is non-alphanum. This broke any single-character key when using SJSON specification in combination with not using quoted strings.
Diffstat (limited to 'core/encoding')
| -rw-r--r-- | core/encoding/json/tokenizer.odin | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/encoding/json/tokenizer.odin b/core/encoding/json/tokenizer.odin index 567600b90..a406a73a5 100644 --- a/core/encoding/json/tokenizer.odin +++ b/core/encoding/json/tokenizer.odin @@ -163,8 +163,9 @@ get_token :: proc(t: ^Tokenizer) -> (token: Token, err: Error) { skip_alphanum :: proc(t: ^Tokenizer) { for t.offset < len(t.data) { - switch next_rune(t) { + switch t.r { case 'A'..='Z', 'a'..='z', '0'..='9', '_': + next_rune(t) continue } |