Isolate float regex matching to 1 char for + and -

This prevents highlighting on the "2" in "auth: oauth2". (signing CLA and sending in now)

Now passes tests and also covers .37 case.

… and updated to cover the ++ or -- case.
This commit is contained in:
Marsh Gardiner 2014-05-09 12:59:45 -07:00 committed by earth2marsh
commit 05f0b3c7f2

View file

@ -79,7 +79,7 @@ var YamlHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric", // float
regex : /[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/
regex : /(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)/
}, {
token : "constant.numeric", // other number
regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/