зеркало из https://github.com/github/ruby.git
symbol.c: dotq in ripper
* symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
898fd2ed2a
Коммит
1a98528cb7
|
@ -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.
|
||||
|
|
|
@ -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)},
|
||||
|
|
2
symbol.c
2
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)
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче