mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add additional hint to the code block guesser.
This commit is contained in:
+5
-3
@@ -55,12 +55,11 @@ bool is_code_block_open(struct mrb_parser_state *parser) {
|
||||
// an argument is the last token
|
||||
code_block_open = false;
|
||||
break;
|
||||
case EXPR_CMDARG:
|
||||
code_block_open = false;
|
||||
break;
|
||||
|
||||
// all states which are unsure
|
||||
|
||||
case EXPR_CMDARG:
|
||||
break;
|
||||
case EXPR_END:
|
||||
// an expression was ended
|
||||
break;
|
||||
@@ -110,6 +109,9 @@ bool is_code_block_open(struct mrb_parser_state *parser) {
|
||||
} else if (strcmp(parser->error_buffer[0].message,
|
||||
"syntax error, unexpected tREGEXP_BEG") == 0) {
|
||||
code_block_open = true;
|
||||
} else if (strcmp(parser->error_buffer[0].message,
|
||||
"unterminated string meets end of file") == 0) {
|
||||
code_block_open = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user