diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-15 08:00:06 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-15 08:00:06 -0700 |
commit | a35fafaffd8eb676fda928cb45929c1559a216a3 (patch) | |
tree | 7009d0925e5c966901d949ad1360ac0ddcc4b018 /pygments/lexers/javascript.py | |
parent | 410f5b1f6998c2cf2ca67070fc20680abc6e0e5d (diff) | |
download | pygments-a35fafaffd8eb676fda928cb45929c1559a216a3.tar.gz |
Use unistring.combine for slight speedup.
Diffstat (limited to 'pygments/lexers/javascript.py')
-rw-r--r-- | pygments/lexers/javascript.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 8b5f9c76..95286fdf 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -22,11 +22,11 @@ __all__ = ['JavascriptLexer', 'KalLexer', 'LiveScriptLexer', 'DartLexer', 'TypeScriptLexer', 'LassoLexer', 'ObjectiveJLexer', 'CoffeeScriptLexer', 'MaskLexer'] -JS_IDENT_START = ('(?:[$_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Lo + uni.Nl - + ']|\\\\u[a-fA-F0-9]{4})') -JS_IDENT_PART = ('(?:[$_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Lo + uni.Nl - + uni.Mn + uni.Mc + uni.Nd + uni.Pc - + u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})') +JS_IDENT_START = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + + ']|\\\\u[a-fA-F0-9]{4})') +JS_IDENT_PART = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Mn', 'Mc', 'Nd', 'Pc') + + u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})') JS_IDENT = JS_IDENT_START + '(?:' + JS_IDENT_PART + ')*' class JavascriptLexer(RegexLexer): |