Skip to content

Commit

Permalink
version 0.63
Browse files Browse the repository at this point in the history
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.63.tar.gz

Tue Dec 20 00:46:19 1994  Yukihiro Matsumoto  (matz@dyna)

	* 0.63 released

	* eval.c(rb_call): superの呼び出しで落ちる.argc, argvの設定を忘れ
	  ていた.

	* parse.y(read_escape): 展開エラー.

	* variable.c: 定義済みの変数のhookを変更しないように.
  • Loading branch information
matz authored and k0kubun committed Aug 17, 2019
1 parent b3f9ba5 commit bd0c733
Show file tree
Hide file tree
Showing 12 changed files with 551 additions and 475 deletions.
8 changes: 5 additions & 3 deletions C-IF
Expand Up @@ -53,11 +53,13 @@ Ruby-C
����ѿ�

void rb_define_variable(char *name, VALUE *var,
VALUE (*get_hook), VALUE (*set_hook)())
VALUE (*get_hook), VALUE (*set_hook)(), void *data)

Ruby��C�ȤǶ�ͭ���륰�����Х��ѿ����������. get_hook��Qnil�Ǥʤ���,
�ѿ����Ȥκݤ�get_hook�˥��åȤ��줿�ؿ����ƤФ��. set_hook��Qnil
�Ǥʤ����ˤ������λ���set_hook���ƤФ��.
�ѿ����Ȥκݤ�get_hook�˥��åȤ��줿�ؿ����ƤФ��. set_hook��Qnil
�Ǥʤ����ˤ������λ���set_hook���ƤФ��. hook�ؿ��ˤ��ѿ�̾�򼨤�
ID��(set hook�ξ�翷�����ͤ�)�ȤȤ��data��Ϳ�����ǡ����������Ȥ�
���Ϥ����.

�ѿ�̾��`$'�ǻϤޤ�ʤ����ˤϼ�ưŪ���ɲä����. �ѿ�̾�Ȥ���ruby��
���̻ҤȤ��Ƶ�����ʤ�ʸ��(�㤨��` ')��ޤ���ˤ�ruby�ץ�����फ
Expand Down
20 changes: 20 additions & 0 deletions ChangeLog
@@ -1,5 +1,25 @@
Tue Dec 20 00:46:19 1994 Yukihiro Matsumoto (matz@dyna)

* 0.63 released

* eval.c(rb_call): super�θƤӽФ�������롥argc, argv�������˺��
�Ƥ�����

* parse.y(read_escape): Ÿ�����顼��

* variable.c: ����Ѥߤ��ѿ���hook���ѹ����ʤ��褦�ˡ�

Mon Dec 19 12:01:10 1994 Yukihiro Matsumoto (matz@ix-02)

* parse.y(cond): ��P�����������֤��줿��硤`-v'���ץ����Ƿ�
�𤬽Ф�褦�ˡ�

* parse.y(**): �Ѿ�黻��`**'��ͥ���̤�ñ��黻�Ҥ��⤯������

* parse.y(and,or): ͥ���̤��㤤�黻��`and', `or'.

* 0.62 released.

* eval.c: ��ɬ�פˤʤä�PUSH_ENV, POP_ENV�򸺤餷����

* env.h: ENVION����self��Ϥ�������PUSH_ENV��super�ν����Τ������
Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -70,6 +70,7 @@ OBJS = array.o \
re.o \
regex.o \
ruby.o \
signal.o \
socket.o \
sprintf.o \
st.o \
Expand Down
15 changes: 12 additions & 3 deletions eval.c
Expand Up @@ -3,7 +3,7 @@
eval.c -
$Author: matz $
$Date: 1994/12/19 08:39:17 $
$Date: 1994/12/20 05:07:05 $
created at: Thu Jun 10 14:22:17 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -548,7 +548,6 @@ rb_eval(node)

sourceline = node->line;

#undef SAFE_SIGHANDLE
#ifdef SAFE_SIGHANDLE
{
extern int trap_pending;
Expand Down Expand Up @@ -1612,6 +1611,8 @@ rb_call(class, recv, mid, argc, argv, func, itr)
else {
the_env->arg_ary = Qnil;
}
the_env->argc = argc;
the_env->argv = argv;

if (nd_type(body) == NODE_CFUNC) {
int len = body->nd_argc;
Expand Down Expand Up @@ -2109,8 +2110,10 @@ Sblk_new(class)
if (!iterator_p() && !Fiterator_p()) {
Fail("tryed to create Block out of iterator");
}

if (the_block->block) return the_block->block;
blk = obj_alloc(C_Block);
blk = obj_alloc(class);

Make_Data_Struct(blk, blkdata, struct BLOCK, Qnil, blk_free, data);
memcpy(data, the_block, sizeof(struct BLOCK));
scope = the_scope;
Expand Down Expand Up @@ -2141,6 +2144,12 @@ Sblk_new(class)
return blk;
}

VALUE
blk_new()
{
return Sblk_new(C_Block);
}

static VALUE
Fblk_do(blk, args)
VALUE blk, args;
Expand Down
3 changes: 2 additions & 1 deletion object.c
Expand Up @@ -3,7 +3,7 @@
object.c -
$Author: matz $
$Date: 1994/12/19 08:30:07 $
$Date: 1994/12/20 05:01:01 $
created at: Thu Jul 15 12:01:24 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -424,6 +424,7 @@ Init_Object()
rb_define_method(C_Kernel, "_inspect", Fkrn_inspect, 0);

rb_define_private_method(C_Kernel, "defined", Fdefined, 1);

rb_define_private_method(C_Kernel, "sprintf", Fsprintf, -1);
rb_define_alias(C_Kernel, "format", "sprintf");

Expand Down
52 changes: 38 additions & 14 deletions parse.y
Expand Up @@ -3,7 +3,7 @@
parse.y -
$Author: matz $
$Date: 1994/12/19 08:30:08 $
$Date: 1994/12/20 05:07:09 $
created at: Fri May 28 18:02:42 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -115,6 +115,8 @@ static void setup_top_local();
RETRY
SELF
NIL
AND
OR
_FILE_
_LINE_
IF_MOD
Expand Down Expand Up @@ -144,7 +146,7 @@ static void setup_top_local();
%token NEQ /* != <> */
%token GEQ /* >= */
%token LEQ /* <= */
%token AND OR /* && and || */
%token ANDOP OROP /* && and || */
%token MATCH NMATCH /* =~ and !~ */
%token DOT2 DOT3 /* .. and ... */
%token AREF ASET /* [] and []= */
Expand All @@ -158,21 +160,23 @@ static void setup_top_local();
* precedence table
*/

%left OR
%left AND
%left YIELD RETURN FAIL
%right '=' OP_ASGN
%right COLON2
%nonassoc DOT2 DOT3
%left OR
%left AND
%left OROP
%left ANDOP
%nonassoc CMP EQ NEQ MATCH NMATCH
%left '>' GEQ '<' LEQ
%left '|' '^'
%left '&'
%left LSHFT RSHFT
%left '+' '-'
%left '*' '/' '%'
%right POW
%right '!' '~' UPLUS UMINUS
%right POW

%token LAST_TOKEN

Expand Down Expand Up @@ -297,6 +301,14 @@ stmt : CLASS IDENTIFIER superclass
{
$$ = NEW_UNTIL2(cond($3), $1);
}
| stmt AND stmt
{
$$ = NEW_AND(cond($1), cond($3));
}
| stmt OR stmt
{
$$ = NEW_OR(cond($1), cond($3));
}
| stmt0

stmt0 : mlhs '=' args2
Expand Down Expand Up @@ -753,11 +765,11 @@ expr : variable '=' expr
{
$$ = call_op($1, COLON2, 1, $3);
}
| expr AND expr
| expr ANDOP expr
{
$$ = NEW_AND(cond($1), cond($3));
}
| expr OR expr
| expr OROP expr
{
$$ = NEW_OR(cond($1), cond($3));
}
Expand Down Expand Up @@ -1335,6 +1347,7 @@ static struct kwtable {
"__END__", 0, EXPR_BEG,
"__FILE__", _FILE_, EXPR_END,
"__LINE__", _LINE_, EXPR_END,
"and", AND, EXPR_BEG,
"break", BREAK, EXPR_END,
"case", CASE, EXPR_BEG,
"class", CLASS, EXPR_BEG,
Expand All @@ -1351,6 +1364,7 @@ static struct kwtable {
"include", INCLUDE, EXPR_BEG,
"module", MODULE, EXPR_BEG,
"nil", NIL, EXPR_END,
"or", OR, EXPR_BEG,
"protect", PROTECT, EXPR_BEG,
"redo", REDO, EXPR_END,
"resque", RESQUE, EXPR_BEG,
Expand Down Expand Up @@ -1556,7 +1570,7 @@ retry:
case '&':
lex_state = EXPR_BEG;
if ((c = nextc()) == '&') {
return AND;
return ANDOP;
}
else if (c == '=') {
yylval.id = '&';
Expand All @@ -1568,7 +1582,7 @@ retry:
case '|':
lex_state = EXPR_BEG;
if ((c = nextc()) == '|') {
return OR;
return OROP;
}
else if (c == '=') {
yylval.id = '|';
Expand Down Expand Up @@ -2080,15 +2094,15 @@ read_escape(flag)
break;

case 'f': /* form-feed */
tokadd('\r');
tokadd('\f');
break;

case 'v': /* vertical tab */
tokadd('\13');
break;

case 'a': /* alarm(bell) */
tokadd('\1');
tokadd('\007');
break;

case 'e': /* escape */
Expand Down Expand Up @@ -2149,11 +2163,10 @@ read_escape(flag)

case 'x': /* hex constant */
{
register int i = c - '0';
register int i = 0;
register int count = 0;

while (++count < 2) {
c = nextc();
while (++count < 3) {
if ((c = nextc()) >= '0' && c <= '9') {
i *= 16;
i += c - '0';
Expand Down Expand Up @@ -2526,6 +2539,17 @@ cond(node)
enum node_type type = nd_type(node);

value_expr(node);
switch (type) {
case NODE_MASGN:
case NODE_LASGN:
case NODE_GASGN:
case NODE_IASGN:
case NODE_CASGN:
if (verbose) {
Warning("asignment in condition");
}
break;
}

node = cond0(node);
if (type == NODE_CALL && node->nd_mid == '!') {
Expand Down

0 comments on commit bd0c733

Please sign in to comment.