summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorKyle Brady <kyle@spark-gap.com>2016-01-11 16:49:05 -0800
committerKyle Brady <kyle@spark-gap.com>2016-01-11 16:49:05 -0800
commit37527ca652581444ccaf6889e95354cdd76ef5af (patch)
treed8dacd0eea7562b9ef1021bd017efacac5389b0e /pygments
parent9fbc49268617422361a6b3f6f8fdff2d2c664db2 (diff)
downloadpygments-37527ca652581444ccaf6889e95354cdd76ef5af.tar.gz
Fix the Chapel lexer's parsing of string literals
The Chapel lexer was trying to parse both the single and double quoted forms of string literals with a single regex rule. This lead to errors on input like: "I'm a string literal!" The fix was to split the rule out into a ' and " version.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/chapel.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/chapel.py b/pygments/lexers/chapel.py
index 5b7be4dd..d69c55f5 100644
--- a/pygments/lexers/chapel.py
+++ b/pygments/lexers/chapel.py
@@ -77,7 +77,8 @@ class ChapelLexer(RegexLexer):
(r'[0-9]+', Number.Integer),
# strings
- (r'["\'](\\\\|\\"|[^"\'])*["\']', String),
+ (r'"(\\\\|\\"|[^"])*"', String),
+ (r"'(\\\\|\\'|[^'])*'", String),
# tokens
(r'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|'