[PRISM] using []= to set kwargs is a syntax error

Fixes [Bug #20952]
This commit is contained in:
Matt Valentine-House 2024-12-13 20:35:54 +00:00
parent 880a90cf2e
commit e194665720
Notes: git 2024-12-13 21:22:54 +00:00
2 changed files with 6 additions and 0 deletions

View File

@ -13767,6 +13767,9 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod
// Replace the name with "[]=".
call->name = pm_parser_constant_id_constant(parser, "[]=", 3);
// Ensure that the arguments for []= don't contain keywords
pm_index_arguments_check(parser, call->arguments, NULL);
pm_node_flag_set((pm_node_t *) call, PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY));
return target;

View File

@ -0,0 +1,3 @@
matrix[5, axis: :y] = 8
^~~~~~~~ unexpected keyword arg given in index assignment; keywords are not allowed in index assignment expressions