summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-23 15:48:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-23 15:48:42 +0000
commit53178fc7db9f899dfdac4f67ace9f72d80d4b50b (patch)
tree837f788017aa4e27683e3ffdb33244bdb8b904e6
parent849b1000b082186b17b851df8fb3b1654fd58cd3 (diff)
* eval.c (rb_call0): must not clear ruby_current_node, or
backtrace cannot be genetated. * intern.h (ruby_yyparse): rather than yyparse(). * parse.y (yylex): nextc() returns -1 at end of input, not 0. * parse.y (newline_node): reduce deplicated newline node. * parse.y (literal_concat): get rid of warning. * parse.y (new_evstr): fixed junk code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog15
-rw-r--r--eval.c5
-rw-r--r--intern.h2
-rw-r--r--parse.y35
-rw-r--r--version.h4
5 files changed, 35 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e7830b..816a141 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Mon Sep 23 23:22:43 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * eval.c (rb_call0): must not clear ruby_current_node, or
+ backtrace cannot be genetated.
+
+ * intern.h (ruby_yyparse): rather than yyparse().
+
+ * parse.y (yylex): nextc() returns -1 at end of input, not 0.
+
+ * parse.y (newline_node): reduce deplicated newline node.
+
+ * parse.y (literal_concat): get rid of warning.
+
+ * parse.y (new_evstr): fixed junk code.
+
Mon Sep 23 19:57:52 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (RUBY_MINGW32): new macro. check for the MinGW
diff --git a/eval.c b/eval.c
index 1a9b77c..fad1451 100644
--- a/eval.c
+++ b/eval.c
@@ -4501,21 +4501,18 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
if (trace_func) {
int state;
- NODE *volatile node = ruby_current_node;
call_trace_func("c-call", ruby_current_node, recv, id, klass);
- ruby_current_node = 0;
PUSH_TAG(PROT_FUNC);
if ((state = EXEC_TAG()) == 0) {
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
}
POP_TAG();
- ruby_current_node = node;
+ ruby_current_node = ruby_frame->node;
call_trace_func("c-return", ruby_current_node, recv, id, klass);
if (state) JUMP_TAG(state);
}
else {
- ruby_current_node = 0;
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
}
}
diff --git a/intern.h b/intern.h
index 84a92b3..0543dc5 100644
--- a/intern.h
+++ b/intern.h
@@ -287,7 +287,7 @@ double rb_str_to_dbl _((VALUE, int));
/* parse.y */
EXTERN int ruby_sourceline;
EXTERN char *ruby_sourcefile;
-int yyparse _((void));
+int ruby_yyparse _((void));
ID rb_id_attrset _((ID));
void rb_parser_append_print _((void));
void rb_parser_while_loop _((int, int));
diff --git a/parse.y b/parse.y
index d38e5e7..4c26554 100644
--- a/parse.y
+++ b/parse.y
@@ -3555,7 +3555,7 @@ yylex()
if (!ISXDIGIT(c)) break;
nondigit = 0;
tokadd(c);
- } while (c = nextc());
+ } while ((c = nextc()) != -1);
}
pushback(c);
tokfix();
@@ -3579,7 +3579,7 @@ yylex()
if (c != '0' && c != '1') break;
nondigit = 0;
tokadd(c);
- } while (c = nextc());
+ } while ((c = nextc()) != -1);
}
pushback(c);
tokfix();
@@ -3603,7 +3603,7 @@ yylex()
if (!ISDIGIT(c)) break;
nondigit = 0;
tokadd(c);
- } while (c = nextc());
+ } while ((c = nextc()) != -1);
}
pushback(c);
tokfix();
@@ -3637,7 +3637,7 @@ yylex()
if (c < '0' || c > '7') break;
nondigit = 0;
tokadd(c);
- } while (c = nextc());
+ } while ((c = nextc()) != -1);
if (toklen() > start) {
pushback(c);
tokfix();
@@ -4147,7 +4147,7 @@ yylex()
else {
if (lex_state == EXPR_FNAME) {
if ((c = nextc()) == '=' && !peek('~') && !peek('>') &&
- (!peek('=') || lex_p + 1 < lex_pend && lex_p[1] == '>')) {
+ (!peek('=') || (lex_p + 1 < lex_pend && lex_p[1] == '>'))) {
result = tIDENTIFIER;
tokadd(c);
}
@@ -4258,6 +4258,7 @@ newline_node(node)
{
NODE *nl = 0;
if (node) {
+ if (nd_type(node) == NODE_NEWLINE) return node;
nl = NEW_NEWLINE(node);
fixpos(nl, node);
nl->nd_nth = nd_line(node);
@@ -4397,7 +4398,7 @@ literal_concat(head, tail)
else {
list_append(head, tail);
}
- return head;
+ break;
case NODE_DSTR:
if (htype == NODE_STR) {
@@ -4411,39 +4412,35 @@ literal_concat(head, tail)
tail->nd_head = NEW_STR(tail->nd_lit);
list_concat(head, tail);
}
- return head;
+ break;
case NODE_EVSTR:
if (htype == NODE_STR) {
nd_set_type(head, NODE_DSTR);
}
list_append(head, tail);
- return head;
+ break;
}
+ return head;
}
static NODE *
new_evstr(node)
NODE *node;
{
- NODE *n;
+ NODE *head = node;
+ again:
if (node) {
switch (nd_type(node)) {
case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
return node;
- case NODE_BLOCK:
- for (n = node; n->nd_next; n = n->nd_next) {
- NODE *h = n->nd_head;
- enum node_type t;
- if (!h) continue;
- if (t != NODE_STR && t != NODE_LIT) goto evstr;
- }
- return n->nd_head;
+ case NODE_NEWLINE:
+ node = node->nd_next;
+ goto again;
}
}
- evstr:
- return NEW_EVSTR(node);
+ return NEW_EVSTR(head);
}
static NODE *
diff --git a/version.h b/version.h
index 8ab8835..af636a5 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.3"
-#define RUBY_RELEASE_DATE "2002-09-22"
+#define RUBY_RELEASE_DATE "2002-09-23"
#define RUBY_VERSION_CODE 173
-#define RUBY_RELEASE_CODE 20020922
+#define RUBY_RELEASE_CODE 20020923