| ... | @@ -190,6 +190,9 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { | ... | @@ -190,6 +190,9 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { |
| 190 | if (characters.items.len == 0) { | 190 | if (characters.items.len == 0) { |
| 191 | return null; | 191 | return null; |
| 192 | } | 192 | } |
| | 193 | if (characters.items.len == 1 and characters.items[0] == '-') { |
| | 194 | return error.JsonExpectedTODO; |
| | 195 | } |
| 193 | if (try p.eatByte('.')) |c| { | 196 | if (try p.eatByte('.')) |c| { |
| 194 | try characters.append(c); | 197 | try characters.append(c); |
| 195 | const l = characters.items.len; | 198 | const l = characters.items.len; |
| ... | @@ -207,7 +210,6 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { | ... | @@ -207,7 +210,6 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { |
| 207 | } | 210 | } |
| 208 | if (characters.items.len == l) return error.JsonExpectedTODO; | 211 | if (characters.items.len == l) return error.JsonExpectedTODO; |
| 209 | } | 212 | } |
| 210 | if (characters.items.len == 1 and characters.items[0] == '-') return error.JsonExpectedTODO; | | |
| 211 | | 213 | |
| 212 | return try p.addNumber(alloc, characters.items); | 214 | return try p.addNumber(alloc, characters.items); |
| 213 | } | 215 | } |