diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-09-10 14:00:48 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-09-10 14:00:48 -0700 |
commit | 91ee9584f9a3e8b8e5e0e9c2f1f2b229ca10323e (patch) | |
tree | 6126a870d9d99cf52dca474b7b59064b3579b935 /parse.y | |
parent | 139510238bcbb8d7fd8022c23a603c51d2acbe2e (diff) |
Macros can't be expressions, so make a function
Macros can't be expressions, that is a GNU extension (I didn't know
that). This commit converts the macro to a function so that everything
will compile correctly on non-GNU compatible compilers.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -347,6 +347,8 @@ add_mark_object(struct parser_params *p, VALUE obj) } return obj; } +#else +static NODE* node_newnode_with_locals(struct parser_params *, enum node_type, VALUE, VALUE, const rb_code_location_t*); #endif static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE, const rb_code_location_t*); @@ -11660,6 +11662,20 @@ local_tbl(struct parser_params *p, VALUE *tmp) return buf; } + +static NODE* +node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1, VALUE a2, const rb_code_location_t *loc) +{ + ID *a0; + NODE *n; + VALUE tbl = 0; + + a0 = local_tbl(p, &tbl); + n = NEW_NODE(type, a0, a1, a2, loc); + tbl && RB_OBJ_WRITTEN(p->ast, Qnil, tbl); + return n; +} + #endif static void |