summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/ripper/eventids2.c1
-rw-r--r--symbol.c2
-rw-r--r--test/ripper/test_scanner_events.rb2
4 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f9d6f90edb..877d0fdcca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Oct 25 10:12:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537]
+
Sat Oct 24 22:51:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* configure.in: fixed build failure of Haiku.
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index abbe584454..5b624c2865 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -257,6 +257,7 @@ static const struct token_assoc {
{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)},
diff --git a/symbol.c b/symbol.c
index 9917795190..f0ba5e7f02 100644
--- a/symbol.c
+++ b/symbol.c
@@ -50,6 +50,7 @@ static ID register_static_symid_str(ID, VALUE);
#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 {
{tCOLON2, "::"},
{tANDOP, "&&"},
{tOROP, "||"},
+ {tDOTQ, ".?"},
};
#define op_tbl_count numberof(op_tbl)
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
index e57300ed0f..56ba646485 100644
--- a/test/ripper/test_scanner_events.rb
+++ b/test/ripper/test_scanner_events.rb
@@ -535,6 +535,8 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase
scan('op', ':[]')
assert_equal ['[]='],
scan('op', ':[]=')
+ assert_equal ['.?'],
+ scan('op', 'a.?f')
assert_equal [],
scan('op', %q[`make all`])
end