From b22bb459e073740790687e67ddb5c03c42aa93b0 Mon Sep 17 00:00:00 2001 From: Ash Searle Date: Thu, 1 Sep 2016 20:39:24 +0100 Subject: Fix for floats with leading/trailing ., reclassify es2015 arrow notation as punctuation and add new es2015 regex flags (sticky and unicode) --- pygments/lexers/javascript.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pygments/lexers/javascript.py') diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index a23ba184..4b47b15a 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -53,7 +53,7 @@ class JavascriptLexer(RegexLexer): 'slashstartsregex': [ include('commentsandwhitespace'), (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' - r'([gim]+\b|\B)', String.Regex, '#pop'), + r'([gimuy]+\b|\B)', String.Regex, '#pop'), (r'(?=/)', Text, ('#pop', 'badregex')), default('#pop') ], @@ -64,9 +64,14 @@ class JavascriptLexer(RegexLexer): (r'\A#! ?/.*?\n', Comment.Hashbang), # recognized by node.js (r'^(?=\s|/|