summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-12 07:42:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-12 07:42:35 +0000
commit3a7020854d43c4d29ca5cd9013e3af139f378548 (patch)
tree2a73f7f17fa97d74f5580248e39f39765747d573 /parse.y
parent2322a131272f705139fb1e6bbcf1d85a0205e8b0 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y15
1 files changed, 8 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index 1121306313..d77e04d381 100644
--- a/parse.y
+++ b/parse.y
@@ -1914,7 +1914,6 @@ yyerror(msg)
}
static int heredoc_end;
-static int last_newline;
int ruby_in_compile = 0;
int ruby__end__seen;
@@ -1954,7 +1953,6 @@ yycompile(f, line)
ruby__end__seen = 0;
ruby_eval_tree = 0;
heredoc_end = 0;
- last_newline = 0;
ruby_sourcefile = f;
ruby_in_compile = 1;
n = yyparse();
@@ -2814,7 +2812,7 @@ yylex()
/* white spaces */
case ' ': case '\t': case '\f': case '\r':
case '\13': /* '\v' */
- space_seen = 1;
+ space_seen++;
goto retry;
case '#': /* it's a comment */
@@ -2982,6 +2980,10 @@ yylex()
return '?';
}
c = nextc();
+ if (c == -1 || c == 10) {
+ rb_compile_error("incomplete character syntax");
+ return 0;
+ }
if (lex_state == EXPR_ARG && ISSPACE(c)){
pushback(c);
lex_state = EXPR_BEG;
@@ -3294,8 +3296,8 @@ yylex()
}
pushback(c);
if (lex_state == EXPR_ARG && space_seen) {
- arg_ambiguous();
if (!ISSPACE(c)) {
+ arg_ambiguous();
return parse_regx('/', '/');
}
}
@@ -3847,10 +3849,9 @@ newline_node(node)
{
NODE *nl = 0;
if (node) {
- if (nd_line(node) == last_newline) return node;
nl = NEW_NEWLINE(node);
fixpos(nl, node);
- last_newline = nl->nd_nth = nd_line(node);
+ nl->nd_nth = nd_line(node);
}
return nl;
}
@@ -4645,7 +4646,7 @@ top_local_setup()
i = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
if (i < len) {
- if (i == 0 || ruby_scope->flag == SCOPE_ALLOCA) {
+ if (i == 0 || (ruby_scope->flag & SCOPE_MALLOC) == 0) {
VALUE *vars = ALLOC_N(VALUE, len+1);
if (ruby_scope->local_vars) {
*vars++ = ruby_scope->local_vars[-1];