diff options
| author | h2so5 <[email protected]> | 2013-04-06 20:10:31 +0900 |
|---|---|---|
| committer | h2so5 <[email protected]> | 2013-04-06 20:32:48 +0900 |
| commit | a258d5752a01255572cbf603f223aba70442d981 (patch) | |
| tree | 9e7951726e43e2aa01fd97df53210197a0e7b645 | |
| parent | e885e59d4537f164b600d2fc579cc195cc8df76f (diff) | |
| download | mruby-a258d5752a01255572cbf603f223aba70442d981.tar.gz mruby-a258d5752a01255572cbf603f223aba70442d981.zip | |
Improve checking for unterminated string in mirb
| -rw-r--r-- | tools/mirb/mirb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index ed3b105b6..ba400bf95 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -38,9 +38,6 @@ is_code_block_open(struct mrb_parser_state *parser) { int code_block_open = FALSE; - /* check for unterminated string */ - if (parser->lex_strterm) return TRUE; - /* check for heredoc */ if (parser->heredoc_starts_nextline) return TRUE; if (parser->heredoc_end_now) { @@ -70,6 +67,9 @@ is_code_block_open(struct mrb_parser_state *parser) return code_block_open; } + /* check for unterminated string */ + if (parser->lex_strterm) return TRUE; + switch (parser->lstate) { /* all states which need more code */ |
