summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-05-23 14:37:54 -0400
committergit <[email protected]>2024-05-23 18:45:04 +0000
commite5e079e70f8b07697f7cc3f64736f993755500cb (patch)
tree620f29b88ab33ab67174b0a55689912798994ed2
parent56a51fcd33f6f3372ab889e7ddc2f20b89db81e2 (diff)
[ruby/prism] Only accept command call when specified for constant path
https://github.com/ruby/prism/commit/0ae908b6ee
-rw-r--r--prism/prism.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/prism/prism.c b/prism/prism.c
index 86a4aa90b0..5499ce4764 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -20714,7 +20714,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t
if (
(parser->current.type == PM_TOKEN_PARENTHESIS_LEFT) ||
- (token_begins_expression_p(parser->current.type) || match3(parser, PM_TOKEN_UAMPERSAND, PM_TOKEN_USTAR, PM_TOKEN_USTAR_STAR))
+ (accepts_command_call && (token_begins_expression_p(parser->current.type) || match3(parser, PM_TOKEN_UAMPERSAND, PM_TOKEN_USTAR, PM_TOKEN_USTAR_STAR)))
) {
// If we have a constant immediately following a '::' operator, then
// this can either be a constant path or a method call, depending on