summaryrefslogtreecommitdiff
path: root/pygments/lexers/ruby.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-06 21:55:49 -0700
committerTim Hatch <tim@timhatch.com>2014-10-06 21:55:49 -0700
commit55cfc317915837ef74f6779be15a478563b4c772 (patch)
treec6a2a4dd83450e37d05c4bd560f8cb920e0d36ba /pygments/lexers/ruby.py
parent855647a8912f4b82209b45d028a69334c37b75d5 (diff)
downloadpygments-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.py12
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),