diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-06 21:55:49 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-06 21:55:49 -0700 |
commit | 55cfc317915837ef74f6779be15a478563b4c772 (patch) | |
tree | c6a2a4dd83450e37d05c4bd560f8cb920e0d36ba /pygments/lexers/ruby.py | |
parent | 855647a8912f4b82209b45d028a69334c37b75d5 (diff) | |
download | pygments-55cfc317915837ef74f6779be15a478563b4c772.tar.gz |
RubyLexer: Be less picky about closing delimiters.
Previous code used a negative lookbehind, which I do not grok how was ever
correct. New code with testcase.
Fixes #1026
Diffstat (limited to 'pygments/lexers/ruby.py')
-rw-r--r-- | pygments/lexers/ruby.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/ruby.py b/pygments/lexers/ruby.py index 88cbafec..096c6dc8 100644 --- a/pygments/lexers/ruby.py +++ b/pygments/lexers/ruby.py @@ -134,8 +134,8 @@ class RubyLexer(ExtendedRegexLexer): ('<', '>', 'ab'): states[name+'-intp-string'] = [ (r'\\[\\' + lbrace + rbrace + ']', String.Other), - (r'(?<!\\)' + lbrace, String.Other, '#push'), - (r'(?<!\\)' + rbrace, String.Other, '#pop'), + (lbrace, String.Other, '#push'), + (rbrace, String.Other, '#pop'), include('string-intp-escaped'), (r'[\\#' + lbrace + rbrace + ']', String.Other), (r'[^\\#' + lbrace + rbrace + ']+', String.Other), @@ -144,8 +144,8 @@ class RubyLexer(ExtendedRegexLexer): name+'-intp-string')) states[name+'-string'] = [ (r'\\[\\' + lbrace + rbrace + ']', String.Other), - (r'(?<!\\)' + lbrace, String.Other, '#push'), - (r'(?<!\\)' + rbrace, String.Other, '#pop'), + (lbrace, String.Other, '#push'), + (rbrace, String.Other, '#pop'), (r'[\\#' + lbrace + rbrace + ']', String.Other), (r'[^\\#' + lbrace + rbrace + ']+', String.Other), ] @@ -153,8 +153,8 @@ class RubyLexer(ExtendedRegexLexer): name+'-string')) states[name+'-regex'] = [ (r'\\[\\' + lbrace + rbrace + ']', String.Regex), - (r'(?<!\\)' + lbrace, String.Regex, '#push'), - (r'(?<!\\)' + rbrace + '[mixounse]*', String.Regex, '#pop'), + (lbrace, String.Regex, '#push'), + (rbrace + '[mixounse]*', String.Regex, '#pop'), include('string-intp'), (r'[\\#' + lbrace + rbrace + ']', String.Regex), (r'[^\\#' + lbrace + rbrace + ']+', String.Regex), |