summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby/patterns.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-03-15 22:23:04 +0000
committermurphy <murphy@rubychan.de>2006-03-15 22:23:04 +0000
commiteb5adf9c2e936d1fd0f5c961d61d1694ed99dc6a (patch)
treeed7325ee1c457dd72ff6aa0299eb0f160267eb87 /lib/coderay/scanners/ruby/patterns.rb
parentfea5260ce014ee521955c5afc929f3cae71a4c73 (diff)
downloadcoderay-eb5adf9c2e936d1fd0f5c961d61d1694ed99dc6a.tar.gz
Ruby scanner fixed - nasty bug in ruby/patterns.rb.
besetzung.in.rb test added. highlight.rb updated.
Diffstat (limited to 'lib/coderay/scanners/ruby/patterns.rb')
-rw-r--r--lib/coderay/scanners/ruby/patterns.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb
index 2933109..9d11be6 100644
--- a/lib/coderay/scanners/ruby/patterns.rb
+++ b/lib/coderay/scanners/ruby/patterns.rb
@@ -155,13 +155,13 @@ module CodeRay module Scanners
] ]
CLOSING_PAREN.values.each { |o| o.freeze } # debug, if I try to change it with <<
- OPENING_PAREN = CLOSING_PAREN.invert
+ p OPENING_PAREN = CLOSING_PAREN.invert
STRING_PATTERN = Hash.new { |h, k|
delim, interpreted = *k
delim_pattern = Regexp.escape(delim.dup)
- if starter = OPENING_PAREN[delim]
- delim_pattern << Regexp.escape(starter)
+ if closing_paren = CLOSING_PAREN[delim]
+ delim_pattern << Regexp.escape(closing_paren)
end
@@ -194,15 +194,15 @@ module CodeRay module Scanners
}
def initialize kind, interpreted, delim, heredoc = false
- if paren = CLOSING_PAREN[delim]
- delim, paren = paren, delim
- paren_depth = 1
- end
if heredoc
pattern = HEREDOC_PATTERN[ [delim, interpreted, heredoc == :indented] ]
delim = nil
else
pattern = STRING_PATTERN[ [delim, interpreted] ]
+ if paren = CLOSING_PAREN[delim]
+ delim, paren = paren, delim
+ paren_depth = 1
+ end
end
super kind, interpreted, delim, heredoc, paren, paren_depth, pattern, :initial
end