From 95d7f5cc2084c983f5b6ad11cbf98eb35c3f0b26 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Wed, 11 Apr 2012 11:45:36 +0200 Subject: [PATCH] lib/lingo/attendee/tokenizer.rb (tokenize): [MINOR] Use "last match" variable instead of indexing into MatchData. --- lib/lingo/attendee/tokenizer.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/lingo/attendee/tokenizer.rb b/lib/lingo/attendee/tokenizer.rb index 12add263..64f42468 100644 --- a/lib/lingo/attendee/tokenizer.rb +++ b/lib/lingo/attendee/tokenizer.rb @@ -161,7 +161,7 @@ def tokenize(textline) case @cont when 'HTML' if textline =~ /^[^<>]*>/ - yield $~[0], @cont + yield $&, @cont textline, @cont = $', nil else yield textline, @cont @@ -169,7 +169,7 @@ def tokenize(textline) end when 'WIKI' if textline =~ /^[^\[\]]*\]\]/ - yield $~[0], @cont + yield $&, @cont textline, @cont = $', nil else yield textline, @cont @@ -177,12 +177,12 @@ def tokenize(textline) end when nil if !@tags && textline =~ /<[^<>]*$/ - yield $~[0], @cont = 'HTML' + yield $&, @cont = 'HTML' textline = $` end if !@wiki && textline =~ /\[\[[^\[\]]*$/ - yield $~[0], @cont = 'WIKI' + yield $&, @cont = 'WIKI' textline = $` end end @@ -190,7 +190,7 @@ def tokenize(textline) until textline.empty? @rules.each { |name, expr| if textline =~ expr - yield $~[0], name if name != 'SPAC' || @space + yield $&, name if name != 'SPAC' || @space textline = $' break end