From 1af4110f7d0802d4055f7dbe36fcb55386602b02 Mon Sep 17 00:00:00 2001 From: FUKUZAWA-Tadashi Date: Sun, 3 Mar 2013 20:08:13 +0900 Subject: implement heredoc --- tools/mirb/mirb.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index 29685cf28..e20de629d 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -40,6 +40,13 @@ is_code_block_open(struct mrb_parser_state *parser) /* check for unterminated string */ if (parser->sterm) return TRUE; + /* check for heredoc */ + if (parser->heredoc_starts_nextline) return TRUE; + if (parser->heredoc_end_now) { + parser->heredoc_end_now = FALSE; + return FALSE; + } + /* check if parser error are available */ if (0 < parser->nerr) { const char *unexpected_end = "syntax error, unexpected $end"; -- cgit v1.2.3