mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
849b1000b0
commit
53178fc7db
5 changed files with 35 additions and 26 deletions
15
ChangeLog
15
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>
|
Mon Sep 23 19:57:52 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (RUBY_MINGW32): new macro. check for the MinGW
|
* configure.in (RUBY_MINGW32): new macro. check for the MinGW
|
||||||
|
|
5
eval.c
5
eval.c
|
@ -4501,21 +4501,18 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
||||||
}
|
}
|
||||||
if (trace_func) {
|
if (trace_func) {
|
||||||
int state;
|
int state;
|
||||||
NODE *volatile node = ruby_current_node;
|
|
||||||
|
|
||||||
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
||||||
ruby_current_node = 0;
|
|
||||||
PUSH_TAG(PROT_FUNC);
|
PUSH_TAG(PROT_FUNC);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
ruby_current_node = node;
|
ruby_current_node = ruby_frame->node;
|
||||||
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ruby_current_node = 0;
|
|
||||||
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
intern.h
2
intern.h
|
@ -287,7 +287,7 @@ double rb_str_to_dbl _((VALUE, int));
|
||||||
/* parse.y */
|
/* parse.y */
|
||||||
EXTERN int ruby_sourceline;
|
EXTERN int ruby_sourceline;
|
||||||
EXTERN char *ruby_sourcefile;
|
EXTERN char *ruby_sourcefile;
|
||||||
int yyparse _((void));
|
int ruby_yyparse _((void));
|
||||||
ID rb_id_attrset _((ID));
|
ID rb_id_attrset _((ID));
|
||||||
void rb_parser_append_print _((void));
|
void rb_parser_append_print _((void));
|
||||||
void rb_parser_while_loop _((int, int));
|
void rb_parser_while_loop _((int, int));
|
||||||
|
|
35
parse.y
35
parse.y
|
@ -3555,7 +3555,7 @@ yylex()
|
||||||
if (!ISXDIGIT(c)) break;
|
if (!ISXDIGIT(c)) break;
|
||||||
nondigit = 0;
|
nondigit = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while ((c = nextc()) != -1);
|
||||||
}
|
}
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
@ -3579,7 +3579,7 @@ yylex()
|
||||||
if (c != '0' && c != '1') break;
|
if (c != '0' && c != '1') break;
|
||||||
nondigit = 0;
|
nondigit = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while ((c = nextc()) != -1);
|
||||||
}
|
}
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
@ -3603,7 +3603,7 @@ yylex()
|
||||||
if (!ISDIGIT(c)) break;
|
if (!ISDIGIT(c)) break;
|
||||||
nondigit = 0;
|
nondigit = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while ((c = nextc()) != -1);
|
||||||
}
|
}
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
@ -3637,7 +3637,7 @@ yylex()
|
||||||
if (c < '0' || c > '7') break;
|
if (c < '0' || c > '7') break;
|
||||||
nondigit = 0;
|
nondigit = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while ((c = nextc()) != -1);
|
||||||
if (toklen() > start) {
|
if (toklen() > start) {
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
@ -4147,7 +4147,7 @@ yylex()
|
||||||
else {
|
else {
|
||||||
if (lex_state == EXPR_FNAME) {
|
if (lex_state == EXPR_FNAME) {
|
||||||
if ((c = nextc()) == '=' && !peek('~') && !peek('>') &&
|
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;
|
result = tIDENTIFIER;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
}
|
}
|
||||||
|
@ -4258,6 +4258,7 @@ newline_node(node)
|
||||||
{
|
{
|
||||||
NODE *nl = 0;
|
NODE *nl = 0;
|
||||||
if (node) {
|
if (node) {
|
||||||
|
if (nd_type(node) == NODE_NEWLINE) return node;
|
||||||
nl = NEW_NEWLINE(node);
|
nl = NEW_NEWLINE(node);
|
||||||
fixpos(nl, node);
|
fixpos(nl, node);
|
||||||
nl->nd_nth = nd_line(node);
|
nl->nd_nth = nd_line(node);
|
||||||
|
@ -4397,7 +4398,7 @@ literal_concat(head, tail)
|
||||||
else {
|
else {
|
||||||
list_append(head, tail);
|
list_append(head, tail);
|
||||||
}
|
}
|
||||||
return head;
|
break;
|
||||||
|
|
||||||
case NODE_DSTR:
|
case NODE_DSTR:
|
||||||
if (htype == NODE_STR) {
|
if (htype == NODE_STR) {
|
||||||
|
@ -4411,39 +4412,35 @@ literal_concat(head, tail)
|
||||||
tail->nd_head = NEW_STR(tail->nd_lit);
|
tail->nd_head = NEW_STR(tail->nd_lit);
|
||||||
list_concat(head, tail);
|
list_concat(head, tail);
|
||||||
}
|
}
|
||||||
return head;
|
break;
|
||||||
|
|
||||||
case NODE_EVSTR:
|
case NODE_EVSTR:
|
||||||
if (htype == NODE_STR) {
|
if (htype == NODE_STR) {
|
||||||
nd_set_type(head, NODE_DSTR);
|
nd_set_type(head, NODE_DSTR);
|
||||||
}
|
}
|
||||||
list_append(head, tail);
|
list_append(head, tail);
|
||||||
return head;
|
break;
|
||||||
}
|
}
|
||||||
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NODE *
|
static NODE *
|
||||||
new_evstr(node)
|
new_evstr(node)
|
||||||
NODE *node;
|
NODE *node;
|
||||||
{
|
{
|
||||||
NODE *n;
|
NODE *head = node;
|
||||||
|
|
||||||
|
again:
|
||||||
if (node) {
|
if (node) {
|
||||||
switch (nd_type(node)) {
|
switch (nd_type(node)) {
|
||||||
case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
|
case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
|
||||||
return node;
|
return node;
|
||||||
case NODE_BLOCK:
|
case NODE_NEWLINE:
|
||||||
for (n = node; n->nd_next; n = n->nd_next) {
|
node = node->nd_next;
|
||||||
NODE *h = n->nd_head;
|
goto again;
|
||||||
enum node_type t;
|
|
||||||
if (!h) continue;
|
|
||||||
if (t != NODE_STR && t != NODE_LIT) goto evstr;
|
|
||||||
}
|
|
||||||
return n->nd_head;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
evstr:
|
return NEW_EVSTR(head);
|
||||||
return NEW_EVSTR(node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NODE *
|
static NODE *
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.7.3"
|
#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_VERSION_CODE 173
|
||||||
#define RUBY_RELEASE_CODE 20020922
|
#define RUBY_RELEASE_CODE 20020923
|
||||||
|
|
Loading…
Add table
Reference in a new issue