diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-15 05:19:54 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-15 05:19:54 +0000 |
commit | c36a6f97f243778d3eb8e973eba89ce2b424b707 (patch) | |
tree | 47e0e1c2829393dad21e5511f4c0e79e8b5f8c95 /node.h | |
parent | 560bb32fb2a04713bdbe5fa51ee2aaa271da91b6 (diff) | |
download | ruby-c36a6f97f243778d3eb8e973eba89ce2b424b707.tar.gz |
node.h: introduce nd_brace to determine if a hash literal is a keyword
NODE_HASH#nd_brace is a flag that is 1 for `foo({ k: 1 })` and 0 for
`foo(k: 1)`.
nd_alen had been abused for the flag (and the implementation is
completely the same), but an explicit name is better to read.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.h')
-rw-r--r-- | node.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -266,6 +266,8 @@ typedef struct RNode { #define nd_orig u2.id #define nd_undef u2.node +#define nd_brace u2.argc + #define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc) #define NEW_DEFN(i,a,d,loc) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d,loc),loc) |