summaryrefslogtreecommitdiff
path: root/pygments/lexers/actionscript.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-12-25 13:16:56 +0100
committerGeorg Brandl <georg@python.org>2020-12-25 13:21:48 +0100
commit681487f82f55fba66f01f9913e4ff103e5b2ef4c (patch)
tree0e3f82343796411c1e9c71f5fa7c31e392d06bf5 /pygments/lexers/actionscript.py
parent6c820019a73a606940d7477619a5a9e6ad38761d (diff)
downloadpygments-git-681487f82f55fba66f01f9913e4ff103e5b2ef4c.tar.gz
all: weed out more backtracking string regexes
Diffstat (limited to 'pygments/lexers/actionscript.py')
-rw-r--r--pygments/lexers/actionscript.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexers/actionscript.py b/pygments/lexers/actionscript.py
index 0d748153..c24d1db3 100644
--- a/pygments/lexers/actionscript.py
+++ b/pygments/lexers/actionscript.py
@@ -37,7 +37,7 @@ class ActionScriptLexer(RegexLexer):
(r'\s+', Text),
(r'//.*?\n', Comment.Single),
(r'/\*.*?\*/', Comment.Multiline),
- (r'/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex),
+ (r'/(\\\\|\\[^\\]|[^/\\\n])*/[gim]*', String.Regex),
(r'[~^*!%&<>|+=:;,/?\\-]+', Operator),
(r'[{}\[\]();.]+', Punctuation),
(words((
@@ -149,7 +149,7 @@ class ActionScript3Lexer(RegexLexer):
bygroups(Keyword, Text, Keyword.Type, Text, Operator)),
(r'//.*?\n', Comment.Single),
(r'/\*.*?\*/', Comment.Multiline),
- (r'/(\\\\|\\/|[^\n])*/[gisx]*', String.Regex),
+ (r'/(\\\\|\\[^\\]|[^\\\n])*/[gisx]*', String.Regex),
(r'(\.)(' + identifier + r')', bygroups(Operator, Name.Attribute)),
(r'(case|default|for|each|in|while|do|break|return|continue|if|else|'
r'throw|try|catch|with|new|typeof|arguments|instanceof|this|'