parse.y: const_decl_gen
* parse.y (const_decl_gen): extract as a function as well as ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
777f15a3b2
commit
d63802b375
14
parse.y
14
parse.y
@ -488,9 +488,8 @@ static NODE *new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID
|
|||||||
|
|
||||||
#define const_path_field(w, n) NEW_COLON2(w, n)
|
#define const_path_field(w, n) NEW_COLON2(w, n)
|
||||||
#define top_const_field(n) NEW_COLON3(n)
|
#define top_const_field(n) NEW_COLON3(n)
|
||||||
#define const_decl(path) ( \
|
static NODE *const_decl_gen(struct parser_params *parser, NODE* path);
|
||||||
((in_def || in_single) ? yyerror("dynamic constant assignment") : (void)0), \
|
#define const_decl(path) const_decl_gen(parser, path)
|
||||||
NEW_CDECL(0, 0, (path)))
|
|
||||||
|
|
||||||
#define var_field(n) (n)
|
#define var_field(n) (n)
|
||||||
#define backref_assign_error(n, a) (rb_backref_error(n), NEW_BEGIN(0))
|
#define backref_assign_error(n, a) (rb_backref_error(n), NEW_BEGIN(0))
|
||||||
@ -10232,6 +10231,15 @@ new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rh
|
|||||||
fixpos(asgn, lhs);
|
fixpos(asgn, lhs);
|
||||||
return asgn;
|
return asgn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NODE *
|
||||||
|
const_decl_gen(struct parser_params *parser, NODE *path)
|
||||||
|
{
|
||||||
|
if (in_def || in_single) {
|
||||||
|
yyerror("dynamic constant assignment");
|
||||||
|
}
|
||||||
|
return NEW_CDECL(0, 0, (path));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static VALUE
|
static VALUE
|
||||||
new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs)
|
new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user