@@ -21619,26 +21619,6 @@ pm_call_node_command_p(const pm_call_node_t *node) {
2161921619 );
2162021620}
2162121621
21622- /**
21623- * Determine if a given write node has a command call as its right-hand side. We
21624- * need this because command calls as the values of writes cannot be extended by
21625- * infix operators.
21626- */
21627- static inline bool
21628- pm_write_node_command_p(const pm_node_t *node) {
21629- pm_node_t *value;
21630- switch (PM_NODE_TYPE(node)) {
21631- case PM_CLASS_VARIABLE_WRITE_NODE: value = ((pm_class_variable_write_node_t *) node)->value; break;
21632- case PM_CONSTANT_PATH_WRITE_NODE: value = ((pm_constant_path_write_node_t *) node)->value; break;
21633- case PM_CONSTANT_WRITE_NODE: value = ((pm_constant_write_node_t *) node)->value; break;
21634- case PM_GLOBAL_VARIABLE_WRITE_NODE: value = ((pm_global_variable_write_node_t *) node)->value; break;
21635- case PM_INSTANCE_VARIABLE_WRITE_NODE: value = ((pm_instance_variable_write_node_t *) node)->value; break;
21636- case PM_LOCAL_VARIABLE_WRITE_NODE: value = ((pm_local_variable_write_node_t *) node)->value; break;
21637- default: return false;
21638- }
21639- return PM_NODE_TYPE_P(value, PM_CALL_NODE) && pm_call_node_command_p((pm_call_node_t *) value);
21640- }
21641-
2164221622/**
2164321623 * Parse an expression at the given point of the parser using the given binding
2164421624 * power to parse subsequent chains. If this function finds a syntax error, it
@@ -21723,13 +21703,9 @@ parse_expression(pm_parser_t *parser, pm_binding_power_t binding_power, bool acc
2172321703 case PM_INSTANCE_VARIABLE_WRITE_NODE:
2172421704 case PM_LOCAL_VARIABLE_WRITE_NODE:
2172521705 // These expressions are statements, by virtue of the right-hand
21726- // side of their write being an implicit array or a command call.
21727- // This mirrors parse.y's behavior where `lhs = command_call`
21728- // reduces to stmt (not expr), preventing and/or from following.
21729- if (pm_binding_powers[parser->current.type].left > PM_BINDING_POWER_MODIFIER) {
21730- if (PM_NODE_FLAG_P(node, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY) || pm_write_node_command_p(node)) {
21731- return node;
21732- }
21706+ // side of their write being an implicit array.
21707+ if (PM_NODE_FLAG_P(node, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY) && pm_binding_powers[parser->current.type].left > PM_BINDING_POWER_MODIFIER) {
21708+ return node;
2173321709 }
2173421710 break;
2173521711 case PM_CALL_NODE:
0 commit comments