You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i have the following token defined: ARITHMETIC: ['+' , '-'],
And all my regular expressions are using the u flag moo will output an an invalid regex escape sequence as \- is apparently uncool when rolling with the u flag.
Changing the token definition to: ARITHMETIC: ['+' , /-/u], works but is not pretty.
moo version 0.5.1
Node version 13.14.0
The text was updated successfully, but these errors were encountered:
@tjvr simplest fix is to escape - as \x2d (which works everywhere) instead of \- (which only works inside [] in Unicode mode, even under Annex B).
It's incomprehensible why TC39 decided to make the RegExp grammar this inconsistently nitpicky (e.g., \{ works fine inside a Unicode character class even though the backslash does nothing).
If i have the following token defined:
ARITHMETIC: ['+' , '-'],
And all my regular expressions are using the
u
flagmoo
will output an an invalid regex escape sequence as\-
is apparently uncool when rolling with theu
flag.Changing the token definition to:
ARITHMETIC: ['+' , /-/u],
works but is not pretty.moo version 0.5.1
Node version 13.14.0
The text was updated successfully, but these errors were encountered: