Javascript lexer missparse floating point numbers without dot

Issue #528 on hold
Former user created an issue

Numbers, which are floating point, but do not include a dot, will not be parsed correctly by the Javascript lexer.


1e5, 1e+5, 12E-2



(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),


(r'[0-9][0-9]\.[0-9]+([eE][+-]?[0-9]+)?[fd]?|[0-9][0-9]([eE][+-]?[0-9]+)[fd]?', Number.Float),

or something similar

in lexers/

Reported by thoka

Comments (2)

  1. tyilo

    This is probably related: 0. should be parsed as [(Token.Literal.Number.Float, '0.')] instead of [(Token.Literal.Number.Integer, '0'), (Token.Punctuation, '.')].

    Also javascript only have floating point numbers, so I don't think JavascriptLexer should use Token.Literal.Number.Integer.

    You can see the wrong syntax highlighting here too:

  2. Log in to comment