summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-11-20 10:39:34 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-11-20 10:39:34 +0900
commitec19c34a209e05156cdce8d317234bc62489148f (patch)
tree8e6da8b2f739a7d506d0d8c8fda67b627364b415
parentf1eeaad84a1b1183c6e5128be0a4efeec6da5e8e (diff)
downloadmruby-ec19c34a209e05156cdce8d317234bc62489148f.tar.gz
mruby-ec19c34a209e05156cdce8d317234bc62489148f.zip
Fixed a bug in `mirb` heredoc handling; fix #3989
-rw-r--r--include/mruby/compile.h1
-rw-r--r--mrbgems/mruby-bin-mirb/tools/mirb/mirb.c4
-rw-r--r--mrbgems/mruby-compiler/core/parse.y1
3 files changed, 0 insertions, 6 deletions
diff --git a/include/mruby/compile.h b/include/mruby/compile.h
index 63ec8aca1..fd735be88 100644
--- a/include/mruby/compile.h
+++ b/include/mruby/compile.h
@@ -143,7 +143,6 @@ struct mrb_parser_state {
mrb_ast_node *heredocs_from_nextline;
mrb_ast_node *parsing_heredoc;
mrb_ast_node *lex_strterm_before_heredoc;
- mrb_bool heredoc_end_now:1; /* for mirb */
void *ylval;
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
index 1880f22f7..19f533acd 100644
--- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
@@ -126,10 +126,6 @@ is_code_block_open(struct mrb_parser_state *parser)
/* check for heredoc */
if (parser->parsing_heredoc != NULL) return TRUE;
- if (parser->heredoc_end_now) {
- parser->heredoc_end_now = FALSE;
- return FALSE;
- }
/* check for unterminated string */
if (parser->lex_strterm) return TRUE;
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index e489dd934..70b9d0fc4 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -1078,7 +1078,6 @@ heredoc_end(parser_state *p)
end_strterm(p);
p->lex_strterm = p->lex_strterm_before_heredoc;
p->lex_strterm_before_heredoc = NULL;
- p->heredoc_end_now = TRUE;
}
else {
/* next heredoc */