[前][次][番号順一覧][スレッド一覧]

ruby-changes:12828

From: nobu <ko1@a...>
Date: Sun, 16 Aug 2009 23:58:57 +0900 (JST)
Subject: [ruby-changes:12828] Ruby:r24557 (trunk): * parse.y (yylex): should dispatch scan-event even when follows

nobu	2009-08-16 23:58:27 +0900 (Sun, 16 Aug 2009)

  New Revision: 24557

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24557

  Log:
    * parse.y (yylex): should dispatch scan-event even when follows
      just after delayed-token.  [ruby-dev:37855] [Bug #1071]

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
    trunk/test/ripper/test_scanner_events.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24556)
+++ ChangeLog	(revision 24557)
@@ -1,3 +1,8 @@
+Sun Aug 16 23:58:22 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (yylex): should dispatch scan-event even when follows
+	  just after delayed-token.  [ruby-dev:37855] [Bug #1071]
+
 Sun Aug 16 22:20:16 2009  Tadayoshi Funaba  <tadf@d...>
 
 	* lib/date/format.rb: reverted.
Index: parse.y
===================================================================
--- parse.y	(revision 24556)
+++ parse.y	(revision 24557)
@@ -7612,7 +7612,6 @@
 #ifdef RIPPER
     if (!NIL_P(parser->delayed)) {
 	ripper_dispatch_delayed_token(parser, t);
-	return t;
     }
     if (t != 0)
 	ripper_dispatch_scan_event(parser, t);
Index: test/ripper/test_scanner_events.rb
===================================================================
--- test/ripper/test_scanner_events.rb	(revision 24556)
+++ test/ripper/test_scanner_events.rb	(revision 24557)
@@ -63,6 +63,11 @@
                   [[2, 0], :on_tstring_content, "heredoc\n"],
                   [[3, 0], :on_heredoc_end, "EOS"]],
                  Ripper.lex("<<EOS\nheredoc\nEOS")
+    assert_equal [[[1, 0], :on_regexp_beg, "/"],
+                  [[1, 1], :on_tstring_content, "foo\n"],
+                  [[2, 0], :on_tstring_content, "bar"],
+                  [[2, 3], :on_regexp_end, "/"]],
+                 Ripper.lex("/foo\nbar/")
   end
 
   def test_location

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]