yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 203 forks source link

Bug in the JSON lexer #1091

Open noughtmare opened 6 years ago

noughtmare commented 6 years ago

Zeroes are not recognized correctly when they are not in pairs:

0

The zero in the example above will not be highlighted as a number.

00

The two zeroes will be recognized again.

000

The last zero in a sequence of three zeroes will not be recognized again.

alexpeits commented 6 years ago

While on this topic, should the lexer be compliant with this specification (meaning no oct/hex numbers and support for negative and scientific numbers)? Happy to submit a patch for that.

noughtmare commented 6 years ago

I think that that compliance with that specification is a good target.

(meaning no oct/hex numbers and support for negative and scientific numbers)

Yeah, it is strange that it was implemented this way in the first place.