[macruby-changes] [4838] DietRB/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Oct 28 03:32:37 PDT 2010
Revision: 4838
http://trac.macosforge.org/projects/ruby/changeset/4838
Author: eloy.de.enige at gmail.com
Date: 2010-10-28 03:32:35 -0700 (Thu, 28 Oct 2010)
Log Message:
-----------
Omit regexp options when checking if the right close token is used.
Modified Paths:
--------------
DietRB/trunk/lib/irb/source.rb
DietRB/trunk/spec/source_spec.rb
Modified: DietRB/trunk/lib/irb/source.rb
===================================================================
--- DietRB/trunk/lib/irb/source.rb 2010-10-28 10:32:25 UTC (rev 4837)
+++ DietRB/trunk/lib/irb/source.rb 2010-10-28 10:32:35 UTC (rev 4838)
@@ -220,7 +220,8 @@
end
def on_regexp_end(token)
- if tokens_match?(@in_regexp, token)
+ token_without_regexp_options = token[0,1]
+ if tokens_match?(@in_regexp, token_without_regexp_options)
@in_regexp = false
@level -= 1
end
Modified: DietRB/trunk/spec/source_spec.rb
===================================================================
--- DietRB/trunk/spec/source_spec.rb 2010-10-28 10:32:25 UTC (rev 4837)
+++ DietRB/trunk/spec/source_spec.rb 2010-10-28 10:32:35 UTC (rev 4838)
@@ -227,13 +227,17 @@
["%r{foo ", " bar}"],
["%r{ foo ", " bar }"],
+ ["%r{ foo ", " bar}i"],
["%r(foo ", " bar)"],
["%r( foo ", " bar )"],
+ ["%r( foo ", " bar)i"],
["%r[foo ", " bar]"],
["%r[ foo ", " bar ]"],
+ ["%r[ foo ", " bar]i"],
["/foo ", " bar/"],
["/ foo ", " bar /"],
+ ["/ foo ", " bar/iu"], # macruby ticket 965
].each do |open, close|
reflect(open).level.should == 1
reflect(open).code_block?.should == false
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101028/db3fff50/attachment.html>
More information about the macruby-changes
mailing list