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>
|
||||
|
||||
* 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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
2
intern.h
2
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));
|
||||
|
|
35
parse.y
35
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 *
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue