[ruby/prism] Disallow empty labels when not allowed
https://github.com/ruby/prism/commit/399ee28dc1
This commit is contained in:
parent
75568d23e9
commit
d86b4041b5
@ -16545,6 +16545,8 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1
|
|||||||
|
|
||||||
pm_string_shared_init(&symbol->unescaped, content.start, content.end);
|
pm_string_shared_init(&symbol->unescaped, content.start, content.end);
|
||||||
node = (pm_node_t *) symbol;
|
node = (pm_node_t *) symbol;
|
||||||
|
|
||||||
|
if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL);
|
||||||
} else if (!lex_interpolation) {
|
} else if (!lex_interpolation) {
|
||||||
// If we don't accept interpolation then we expect the string to
|
// If we don't accept interpolation then we expect the string to
|
||||||
// start with a single string content node.
|
// start with a single string content node.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user