diff options
author | gbrandl <devnull@localhost> | 2006-10-30 10:28:26 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-10-30 10:28:26 +0100 |
commit | 2c0b1bae7a5f3416b75ca76fc93cad8bf422a08d (patch) | |
tree | cd9083871c680c73ac13e8e14ac9bc704b47737a | |
parent | a8fdbfc1e96a22fad673e6170822518a292eaf98 (diff) | |
download | pygments-2c0b1bae7a5f3416b75ca76fc93cad8bf422a08d.tar.gz |
[svn] Fix condensed_ruby example lexing.
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | pygments/lexers/agile.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/condensed_ruby.rb | 2 |
3 files changed, 2 insertions, 4 deletions
@@ -32,7 +32,7 @@ for 0.6 * bash * mysql/postgresql/sqlite * tcl - * (la)tex + * latex special formatting? - tell the PHP and DelphiLexer how to differ between Operators and text. diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index 707bad33..ee0cd368 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -392,7 +392,7 @@ class RubyLexer(ExtendedRegexLexer): r'warn)\b', Name.Builtin), (r'__(FILE|LINE)__\b', Name.Builtin.Pseudo), # normal heredocs - (r'(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)', heredoc_callback), + (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)', heredoc_callback), # empty string heredocs (r'(<<-?)("|\')()(\2)(.*?\n)', heredoc_callback), (r'__END__', Comment.Preproc, 'end-part'), diff --git a/tests/examplefiles/condensed_ruby.rb b/tests/examplefiles/condensed_ruby.rb index ee670ff8..afe57aaa 100644 --- a/tests/examplefiles/condensed_ruby.rb +++ b/tests/examplefiles/condensed_ruby.rb @@ -8,5 +8,3 @@ x(U)).each{|n|p,c=x(n),c(n);(c.f(p,O[0],0).map{|f|s f}-D["*"]).each{|f|F.open(f, "w"){|o|o<<c.f(p,f,1)}}}||(DRb.start_service U,C.new{def f(c,a=[],t=2)c==x(U)&&( t==0&&D[s(a)]||t==1&&F.read(s(a))||p(a))end;def y()(p(U)+p).each{|u|c(u).f(x(u), p(U))rescue()};self;end;private;def p(x=[]);O.push(*x).uniq!;O;end}.new.y;sleep) -t==0&&D[s(a)]||t==1&&F.read(s(a))||p(a))end;def y()(p(U)+p).each{|u|c(u).f(x(u), -p(U))rescue()};self;end;private;def p(x=[]);O.push(*x).uniq!;O;end}.new.y;sleep) |