Commit a258d575 authored by h2so5's avatar h2so5

Improve checking for unterminated string in mirb

parent e885e59d
...@@ -38,9 +38,6 @@ is_code_block_open(struct mrb_parser_state *parser) ...@@ -38,9 +38,6 @@ is_code_block_open(struct mrb_parser_state *parser)
{ {
int code_block_open = FALSE; int code_block_open = FALSE;
/* check for unterminated string */
if (parser->lex_strterm) return TRUE;
/* check for heredoc */ /* check for heredoc */
if (parser->heredoc_starts_nextline) return TRUE; if (parser->heredoc_starts_nextline) return TRUE;
if (parser->heredoc_end_now) { if (parser->heredoc_end_now) {
...@@ -70,6 +67,9 @@ is_code_block_open(struct mrb_parser_state *parser) ...@@ -70,6 +67,9 @@ is_code_block_open(struct mrb_parser_state *parser)
return code_block_open; return code_block_open;
} }
/* check for unterminated string */
if (parser->lex_strterm) return TRUE;
switch (parser->lstate) { switch (parser->lstate) {
/* all states which need more code */ /* all states which need more code */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment