| ... | @@ -174,11 +174,11 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { | ... | @@ -174,11 +174,11 @@ fn parseNumber(alloc: std.mem.Allocator, p: *Parser) anyerror!?ValueIndex { |
| 174 | try characters.append(c); | 174 | try characters.append(c); |
| 175 | | 175 | |
| 176 | if (try p.eatByte('0')) |_| { | 176 | if (try p.eatByte('0')) |_| { |
| 177 | return try p.addNumber(alloc, "-0"); | 177 | if (p.slice()[0] != '.') return try p.addNumber(alloc, "-0"); |
| 178 | } | 178 | } |
| 179 | } | 179 | } |
| 180 | if (try p.eatByte('0')) |_| { | 180 | if (try p.eatByte('0')) |_| { |
| 181 | return try p.addNumber(alloc, "0"); | 181 | if (p.slice()[0] != '.') return try p.addNumber(alloc, "0"); |
| 182 | } | 182 | } |
| 183 | while (try p.eatRange('0', '9')) |d| { | 183 | while (try p.eatRange('0', '9')) |d| { |
| 184 | try characters.append(d); | 184 | try characters.append(d); |