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

ruby-changes:40195

From: nobu <ko1@a...>
Date: Sun, 25 Oct 2015 10:12:15 +0900 (JST)
Subject: [ruby-changes:40195] nobu:r52276 (trunk): symbol.c: dotq in ripper

nobu	2015-10-25 10:12:07 +0900 (Sun, 25 Oct 2015)

  New Revision: 52276

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

  Log:
    symbol.c: dotq in ripper
    
    * symbol.c (op_tbl): add DOTQ for ripper.  [Feature #11537]

  Modified files:
    trunk/ChangeLog
    trunk/ext/ripper/eventids2.c
    trunk/symbol.c
    trunk/test/ripper/test_scanner_events.rb
Index: symbol.c
===================================================================
--- symbol.c	(revision 52275)
+++ symbol.c	(revision 52276)
@@ -50,6 +50,7 @@ static ID register_static_symid_str(ID, https://github.com/ruby/ruby/blob/trunk/symbol.c#L50
 #define tCOLON2 RUBY_TOKEN(COLON2)
 #define tANDOP  RUBY_TOKEN(ANDOP)
 #define tOROP   RUBY_TOKEN(OROP)
+#define tDOTQ   RUBY_TOKEN(DOTQ)
 
 static const struct {
     unsigned short token;
@@ -75,6 +76,7 @@ static const struct { https://github.com/ruby/ruby/blob/trunk/symbol.c#L76
     {tCOLON2,   "::"},
     {tANDOP,    "&&"},
     {tOROP,     "||"},
+    {tDOTQ,     ".?"},
 };
 
 #define op_tbl_count numberof(op_tbl)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52275)
+++ ChangeLog	(revision 52276)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Oct 25 10:12:05 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* symbol.c (op_tbl): add DOTQ for ripper.  [Feature #11537]
+
 Sat Oct 24 22:51:18 2015  SHIBATA Hiroshi  <hsbt@r...>
 
 	* configure.in: fixed build failure of Haiku.
Index: ext/ripper/eventids2.c
===================================================================
--- ext/ripper/eventids2.c	(revision 52275)
+++ ext/ripper/eventids2.c	(revision 52276)
@@ -257,6 +257,7 @@ static const struct token_assoc { https://github.com/ruby/ruby/blob/trunk/ext/ripper/eventids2.c#L257
     {tRSHFT,			O(op)},
     {tSTAR,			O(op)},
     {tDSTAR,			O(op)},
+    {tDOTQ,			O(op)},
     {tSTRING_BEG,		O(tstring_beg)},
     {tSTRING_CONTENT,		O(tstring_content)},
     {tSTRING_DBEG,		O(embexpr_beg)},
Index: test/ripper/test_scanner_events.rb
===================================================================
--- test/ripper/test_scanner_events.rb	(revision 52275)
+++ test/ripper/test_scanner_events.rb	(revision 52276)
@@ -535,6 +535,8 @@ class TestRipper::ScannerEvents < Test:: https://github.com/ruby/ruby/blob/trunk/test/ripper/test_scanner_events.rb#L535
                  scan('op', ':[]')
     assert_equal ['[]='],
                  scan('op', ':[]=')
+    assert_equal ['.?'],
+                 scan('op', 'a.?f')
     assert_equal [],
                  scan('op', %q[`make all`])
   end

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

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