diff options
author | Kyle Brady <kyle@spark-gap.com> | 2016-01-11 16:49:05 -0800 |
---|---|---|
committer | Kyle Brady <kyle@spark-gap.com> | 2016-01-11 16:49:05 -0800 |
commit | 37527ca652581444ccaf6889e95354cdd76ef5af (patch) | |
tree | d8dacd0eea7562b9ef1021bd017efacac5389b0e /pygments | |
parent | 9fbc49268617422361a6b3f6f8fdff2d2c664db2 (diff) | |
download | pygments-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.py | 3 |
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'(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|' |