summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-31 05:31:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-31 05:31:20 +0000
commit470c941ce5bd1800fc24f271c6234cee096fd592 (patch)
tree124a826f07c07015f08bc835b057200570f91671 /parse.y
parent2e42f37a020ce9c94f7d41e69b3e3ffec43a54ce (diff)
id.h: independent from parse.h
* template/id.h.tmpl, tool/id2token.rb: make id.h independent from parse.h, and make parse.c dependent on it instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y42
1 files changed, 21 insertions, 21 deletions
diff --git a/parse.y b/parse.y
index 590f2aaace..67bd7108be 100644
--- a/parse.y
+++ b/parse.y
@@ -744,25 +744,25 @@ static void token_info_pop(struct parser_params*, const char *token);
%type <val> program reswords then do dot_or_colon
%*/
%token END_OF_INPUT 0 "end-of-input"
-%token tUPLUS "unary+"
-%token tUMINUS "unary-"
-%token tPOW "**"
-%token tCMP "<=>"
-%token tEQ "=="
-%token tEQQ "==="
-%token tNEQ "!="
-%token tGEQ ">="
-%token tLEQ "<="
+%token tUPLUS RUBY_TOKEN(UPLUS) "unary+"
+%token tUMINUS RUBY_TOKEN(UMINUS) "unary-"
+%token tPOW RUBY_TOKEN(POW) "**"
+%token tCMP RUBY_TOKEN(CMP) "<=>"
+%token tEQ RUBY_TOKEN(EQ) "=="
+%token tEQQ RUBY_TOKEN(EQQ) "==="
+%token tNEQ RUBY_TOKEN(NEQ) "!="
+%token tGEQ RUBY_TOKEN(GEQ) ">="
+%token tLEQ RUBY_TOKEN(LEQ) "<="
%token tANDOP "&&"
%token tOROP "||"
-%token tMATCH "=~"
-%token tNMATCH "!~"
-%token tDOT2 ".."
-%token tDOT3 "..."
-%token tAREF "[]"
-%token tASET "[]="
-%token tLSHFT "<<"
-%token tRSHFT ">>"
+%token tMATCH RUBY_TOKEN(MATCH) "=~"
+%token tNMATCH RUBY_TOKEN(NMATCH) "!~"
+%token tDOT2 RUBY_TOKEN(DOT2) ".."
+%token tDOT3 RUBY_TOKEN(DOT3) "..."
+%token tAREF RUBY_TOKEN(AREF) "[]"
+%token tASET RUBY_TOKEN(ASET) "[]="
+%token tLSHFT RUBY_TOKEN(LSHFT) "<<"
+%token tRSHFT RUBY_TOKEN(RSHFT) ">>"
%token tCOLON2 "::"
%token tCOLON3 ":: at EXPR_BEG"
%token <id> tOP_ASGN /* +=, -= etc. */
@@ -9918,8 +9918,8 @@ static struct symbols {
st_table *ivar2_id;
st_table *id_ivar2;
#endif
- VALUE op_sym[tLAST_TOKEN];
-} global_symbols = {tLAST_ID};
+ VALUE op_sym[tLAST_OP_ID];
+} global_symbols = {tLAST_TOKEN};
static const struct st_hash_type symhash = {
rb_str_hash_cmp,
@@ -9977,7 +9977,7 @@ rb_gc_mark_symbols(void)
{
rb_mark_tbl(global_symbols.id_str);
rb_gc_mark_locations(global_symbols.op_sym,
- global_symbols.op_sym + tLAST_TOKEN);
+ global_symbols.op_sym + numberof(global_symbols.op_sym));
}
#endif /* !RIPPER */
@@ -10264,7 +10264,7 @@ intern_str(VALUE str)
if (m[last] == '=') {
/* attribute assignment */
id = rb_intern3(name, last, enc);
- if (id > tLAST_TOKEN && !is_attrset_id(id)) {
+ if (id > tLAST_OP_ID && !is_attrset_id(id)) {
enc = rb_enc_get(rb_id2str(id));
id = rb_id_attrset(id);
goto id_register;