Skip to content

Commit

Permalink
[PRISM] Blocks are also a syntax error in array assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Dec 13, 2024
1 parent f757141 commit 83273ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion prism/prism.c
Original file line number Diff line number Diff line change
Expand Up @@ -13769,7 +13769,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod
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_index_arguments_check(parser, call->arguments, call->block);
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;
Expand Down
3 changes: 3 additions & 0 deletions test/prism/errors/block_args_in_array_assignment.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matrix[5, &block] = 8
^~~~~~ unexpected block arg given in index assignment; blocks are not allowed in index assignment expressions

0 comments on commit 83273ac

Please sign in to comment.