Issue #528 new

Javascript lexer missparse floating point numbers without dot

Anonymous created an issue

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

Example:

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

Fix:

change

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

to

(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/web.py

Reported by thoka

Comments (0)

  1. Log in to comment