Skip to content

Commit

Permalink
Rename DOTQ to ANDDOT
Browse files Browse the repository at this point in the history
* defs/id.def, parse.y: Switch internal token name to reflect
  current form of safe-call operator.  [Fix rubyGH-1090]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Nov 10, 2015
1 parent 16e7869 commit a01b645
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Nov 10 18:42:24 2015 Aleksandrs Ledovskis <aleksandrs@ledovskis.lv>

* defs/id.def, parse.y: Switch internal token name to reflect
current form of safe-call operator. [Fix GH-1090]

Tue Nov 10 18:25:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>

* hash.c (rb_hash_to_proc): use rb_func_proc_new to make light
Expand Down
2 changes: 1 addition & 1 deletion defs/id.def
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ token_ops = %[\
COLON3 ::
ANDOP &&
OROP ||
DOTQ &.
ANDDOT &.
]

class KeywordError < RuntimeError
Expand Down
2 changes: 1 addition & 1 deletion ext/ripper/eventids2.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static const struct token_assoc {
{tRSHFT, O(op)},
{tSTAR, O(op)},
{tDSTAR, O(op)},
{tDOTQ, O(op)},
{tANDDOT, O(op)},
{tSTRING_BEG, O(tstring_beg)},
{tSTRING_CONTENT, O(tstring_content)},
{tSTRING_DBEG, O(embexpr_beg)},
Expand Down
12 changes: 6 additions & 6 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int parser_yyerror(struct parser_params*, const char*);
#define ruby_coverage (parser->coverage)
#endif

#define CALL_Q_P(q) ((q) == tDOTQ)
#define CALL_Q_P(q) ((q) == tANDDOT)
#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
#define NEW_QCALL(q,r,m,a) NEW_NODE(NODE_CALL_Q(q),r,m,a)

Expand Down Expand Up @@ -875,7 +875,7 @@ static void token_info_pop(struct parser_params*, const char *token, size_t len)
%token tASET RUBY_TOKEN(ASET) "[]="
%token tLSHFT RUBY_TOKEN(LSHFT) "<<"
%token tRSHFT RUBY_TOKEN(RSHFT) ">>"
%token tDOTQ RUBY_TOKEN(DOTQ) "&."
%token tANDDOT RUBY_TOKEN(ANDDOT) "&."
%token tCOLON2 "::"
%token tCOLON3 ":: at EXPR_BEG"
%token <id> tOP_ASGN /* +=, -= etc. */
Expand Down Expand Up @@ -5117,12 +5117,12 @@ call_op : '.'
$$ = ripper_id2sym('.');
%*/
}
| tDOTQ
| tANDDOT
{
/*%%%*/
$$ = tDOTQ;
$$ = tANDDOT;
/*%
$$ = ripper_id2sym(idDOTQ);
$$ = ripper_id2sym(idANDDOT);
%*/
}
;
Expand Down Expand Up @@ -8278,7 +8278,7 @@ parser_yylex(struct parser_params *parser)
}
else if (c == '.') {
lex_state = EXPR_DOT;
return tDOTQ;
return tANDDOT;
}
pushback(c);
if (IS_SPCARG(c)) {
Expand Down

0 comments on commit a01b645

Please sign in to comment.