diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-10-01 09:45:09 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-10-01 13:51:05 +0000 |
| commit | d86b4041b5eca43eea581e4af874e3fd46faaaa2 (patch) | |
| tree | 5569f0a9c74172df9b1604c082e0fa49fd9a6ff0 | |
| parent | 75568d23e90148490208e3ac5b719406b3e9f75f (diff) | |
[ruby/prism] Disallow empty labels when not allowed
https://github.com/ruby/prism/commit/399ee28dc1
| -rw-r--r-- | prism/prism.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/prism/prism.c b/prism/prism.c index 4bbcf0ea9d..a99fb712e3 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -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); node = (pm_node_t *) symbol; + + if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (!lex_interpolation) { // If we don't accept interpolation then we expect the string to // start with a single string content node. |
