[ruby/prism] Swap around order of predicates for assoc static literal
https://github.com/ruby/prism/commit/ec181a3b68
This commit is contained in:
parent
4c5a1dad0a
commit
ccef391140
@ -2287,10 +2287,10 @@ pm_assoc_node_create(pm_parser_t *parser, pm_node_t *key, const pm_token_t *oper
|
|||||||
// If the key and value of this assoc node are both static literals, then
|
// If the key and value of this assoc node are both static literals, then
|
||||||
// we can mark this node as a static literal.
|
// we can mark this node as a static literal.
|
||||||
pm_node_flags_t flags = 0;
|
pm_node_flags_t flags = 0;
|
||||||
if (value &&
|
if (
|
||||||
!PM_NODE_TYPE_P(key, PM_ARRAY_NODE) && !PM_NODE_TYPE_P(key, PM_HASH_NODE) && !PM_NODE_TYPE_P(key, PM_RANGE_NODE) &&
|
!PM_NODE_TYPE_P(key, PM_ARRAY_NODE) && !PM_NODE_TYPE_P(key, PM_HASH_NODE) && !PM_NODE_TYPE_P(key, PM_RANGE_NODE) &&
|
||||||
!PM_NODE_TYPE_P(value, PM_ARRAY_NODE) && !PM_NODE_TYPE_P(value, PM_HASH_NODE) && !PM_NODE_TYPE_P(value, PM_RANGE_NODE)
|
value && !PM_NODE_TYPE_P(value, PM_ARRAY_NODE) && !PM_NODE_TYPE_P(value, PM_HASH_NODE) && !PM_NODE_TYPE_P(value, PM_RANGE_NODE)
|
||||||
) {
|
) {
|
||||||
flags = key->flags & value->flags & PM_NODE_FLAG_STATIC_LITERAL;
|
flags = key->flags & value->flags & PM_NODE_FLAG_STATIC_LITERAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user