зеркало из https://github.com/github/ruby.git
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:
Родитель
777f15a3b2
Коммит
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 top_const_field(n) NEW_COLON3(n)
|
||||
#define const_decl(path) ( \
|
||||
((in_def || in_single) ? yyerror("dynamic constant assignment") : (void)0), \
|
||||
NEW_CDECL(0, 0, (path)))
|
||||
static NODE *const_decl_gen(struct parser_params *parser, NODE* path);
|
||||
#define const_decl(path) const_decl_gen(parser, path)
|
||||
|
||||
#define var_field(n) (n)
|
||||
#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);
|
||||
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
|
||||
static VALUE
|
||||
new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs)
|
||||
|
|
Загрузка…
Ссылка в новой задаче