summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-06-07 16:47:03 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-06-07 16:47:03 +0900
commit24b02955d362fcb7962ccf874158550c1f67aaa2 (patch)
treed0608206e9bcb74d5848ffd29c07747c26c9071c /src/parse.y
parentd3fda42eb62b4132eb91fb75acc28d3218415c8b (diff)
parent9709fe79a3a75eefc92329cc0b74e159ff31525f (diff)
downloadmruby-24b02955d362fcb7962ccf874158550c1f67aaa2.tar.gz
mruby-24b02955d362fcb7962ccf874158550c1f67aaa2.zip
git push origin masterMerge branch 'suzukaze-add-string.clear2'
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/parse.y b/src/parse.y
index 1d4e83cde..27c2dd80d 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3389,7 +3389,7 @@ nextc(parser_state *p)
else {
if (p->cxt->partial_hook(p) < 0)
return -1;
- return -2;
+ return '\n';
}
}
@@ -3777,7 +3777,6 @@ read_escape(parser_state *p)
eof:
case -1:
- case -2:
yyerror(p, "Invalid escape character syntax");
return '\0';
@@ -4093,7 +4092,6 @@ parser_yylex(parser_state *p)
case '#': /* it's a comment */
skip(p, '\n');
/* fall through */
- case -2: /* end of partial script. */
case '\n':
maybe_heredoc:
heredoc_treat_nextline(p);
@@ -4128,7 +4126,6 @@ parser_yylex(parser_state *p)
goto retry;
}
case -1: /* EOF */
- case -2: /* end of partial script */
goto normal_newline;
default:
pushback(p, c);
@@ -5450,7 +5447,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
sym = mrb_intern_cstr(p->mrb, f);
p->filename = mrb_sym2name_len(p->mrb, sym, NULL);
- p->lineno = (p->filename_table_length > 0)? 0 : 1;
+ p->lineno = (p->filename_table_length > 0)? -1 : 1;
for (i = 0; i < p->filename_table_length; ++i) {
if (p->filename_table[i] == sym) {