Skip to content

Commit d86b404

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/prism] Disallow empty labels when not allowed
ruby/prism@399ee28dc1
1 parent 75568d2 commit d86b404

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

prism/prism.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16545,6 +16545,8 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1
1654516545

1654616546
pm_string_shared_init(&symbol->unescaped, content.start, content.end);
1654716547
node = (pm_node_t *) symbol;
16548+
16549+
if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL);
1654816550
} else if (!lex_interpolation) {
1654916551
// If we don't accept interpolation then we expect the string to
1655016552
// start with a single string content node.

0 commit comments

Comments
 (0)