summaryrefslogtreecommitdiff
path: root/prism
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-12-06 15:52:26 -0500
committergit <svn-admin@ruby-lang.org>2023-12-06 21:34:48 +0000
commitc5a4409f20e816d3777ebd2c23b894022342a975 (patch)
treeadb3dec82f8ff0c02a5995841c2d96ec089980d5 /prism
parentc8b60c8ac2c8bbd077150792b5b207e983ab3634 (diff)
[ruby/prism] Simplify unterminated string
https://github.com/ruby/prism/commit/ef512ca914
Diffstat (limited to 'prism')
-rw-r--r--prism/prism.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/prism/prism.c b/prism/prism.c
index 7eeed37ade..15195ea5cd 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -13594,10 +13594,10 @@ parse_strings(pm_parser_t *parser, pm_node_t *current) {
pm_string_t unescaped = parser->current_string;
parser_lex(parser);
- if (match1(parser, PM_TOKEN_STRING_END)) {
+ if (match2(parser, PM_TOKEN_STRING_END, PM_TOKEN_EOF)) {
node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped);
node->flags |= parse_unescaped_encoding(parser);
- parser_lex(parser);
+ expect1(parser, PM_TOKEN_STRING_END, PM_ERR_STRING_LITERAL_TERM);
} else if (accept1(parser, PM_TOKEN_LABEL_END)) {
node = (pm_node_t *) pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped);
} else {