Skip to content

Commit

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

Wed Mar 15 14:59:18 1995  Yukihiro Matsumoto  (matz@ix-02)

	* version 0.69

	* eval.c(method_missing): unknownから名称変更.

	* eval.c(single_method_added): 特異メソッドが定義された時に呼ばれ
	  るメソッド.hookとして使える.実際に定義される直前に呼ばれる.

Tue Mar 14 14:46:44 1995  Yukihiro Matsumoto  (matz@ix-02)

	* ruby.c(proc_options): 引数の解析を自分でやることにより引数指定の
	  方法がperlに近付いた.getopt_longはもう使わない.

	* dir.c(glob): `{}'のネストを許すようにした.

Mon Mar 13 17:56:25 1995  Yukihiro Matsumoto  (matz@ix-02)

	* glob.c: Glob(ワイルドカードオブジェクト)はなくなった.ワイルドカー
	  ドの展開はDir.glob(文字列)を使う.ワイルドカードのマッチは正規表
	  現で代用.

Fri Mar 10 18:35:46 1995  Yukihiro Matsumoto  (matz@ix-02)

	* eval.c: Mathのようなモジュールは自分自身でextendする.

	* eval.c: クラスやモジュールを定義した既に同名のものがあれば追加定
	  義となるように.ただし.superクラスの違いなどはチェックする.

	* regex.c: debug.

	* math.c: 定数PIとEを定義.

Thu Mar  9 21:35:12 1995  Yukihiro Matsumoto  (matz@ix-02)

	* regex.c: EUC,SJISモードでは0x80以上の8進,16進リテラルを禁止.

	* regex.c: クラス内でも数値リテラル・文字クラスが使えるようした.

Wed Mar  8 17:39:05 1995  Yukihiro Matsumoto  (matz@ix-02)

	* regex.c: \200など括弧の数以上の表現は8進リテラルと解釈する.ただ
	  し,\1から\9までは例外.

	* regex.c: \9以上のリファレンスも有効にした.

Tue Mar  7 14:26:01 1995  Yukihiro Matsumoto  (matz@ix-02)

	* eval.c(public/private): スコープ制御メソッドの名称変更.静的なア
	  クセスも出来るようにしてみたが,不採用.

Mon Mar  6 19:34:32 1995  Yukihiro Matsumoto  (matz@ix-02)

	* eval.c(inlcude): メソッド化.動的にモジュールをインクルードでき
	  るように.さらに任意のオブジェクトにもモジュールをインクルードで
	  きるメソッド `extend'も用意した.

	* parse.y: 文法からincludeを削除.メソッド化.

Tue Feb 28 15:35:10 1995  Yukihiro Matsumoto  (matz@ix-02)

	* parse.y: 配列,連想配列の最後に`,'をおけるように.
  • Loading branch information
matz authored and k0kubun committed Aug 17, 2019
1 parent 881c5a9 commit d349889
Show file tree
Hide file tree
Showing 45 changed files with 2,081 additions and 3,193 deletions.
63 changes: 63 additions & 0 deletions ChangeLog
@@ -1,3 +1,66 @@
Wed Mar 15 14:59:18 1995 Yukihiro Matsumoto (matz@ix-02)

* version 0.69

* eval.c(method_missing): unknown����̾���ѹ���

* eval.c(single_method_added): �ðۥ᥽�åɤ�������줿���˸ƤФ�
��᥽�åɡ�hook�Ȥ��ƻȤ��롥�ºݤ���������ľ���˸ƤФ�롥

Tue Mar 14 14:46:44 1995 Yukihiro Matsumoto (matz@ix-02)

* ruby.c(proc_options): �����β��Ϥ�ʬ�Ǥ�뤳�Ȥˤ����������
��ˡ��perl�˶��դ�����getopt_long�Ϥ⤦�Ȥ�ʤ���

* dir.c(glob): `{}'�Υͥ��Ȥ�����褦�ˤ�����

Mon Mar 13 17:56:25 1995 Yukihiro Matsumoto (matz@ix-02)

* glob.c: Glob(�磻��ɥ����ɥ��֥�������)�Ϥʤ��ʤä����磻��ɥ���
�ɤ�Ÿ����Dir.glob(ʸ����)��Ȥ����磻��ɥ����ɤΥޥå�������ɽ
�������ѡ�

Fri Mar 10 18:35:46 1995 Yukihiro Matsumoto (matz@ix-02)

* eval.c: Math�Τ褦�ʥ⥸�塼��ϼ�ʬ���Ȥ�extend���롥

* eval.c: ���饹��⥸�塼��������������Ʊ̾�Τ�Τ�������ɲ���
���Ȥʤ�褦�ˡ���������super���饹�ΰ㤤�ʤɤϥ����å����롥

* regex.c: debug.

* math.c: ���PI��E�������

Thu Mar 9 21:35:12 1995 Yukihiro Matsumoto (matz@ix-02)

* regex.c: EUC,SJIS�⡼�ɤǤ�0x80�ʾ��8�ʡ�16�ʥ�ƥ���ػߡ�

* regex.c: ���饹��Ǥ���ͥ�ƥ�롦ʸ�����饹���Ȥ���褦������

Wed Mar 8 17:39:05 1995 Yukihiro Matsumoto (matz@ix-02)

* regex.c: \200�ʤɳ�̤ο��ʾ��ɽ����8�ʥ�ƥ��Ȳ�᤹�롥����
����\1����\9�ޤǤ��㳰��

* regex.c: \9�ʾ�Υ�ե���󥹤�ͭ���ˤ�����

Tue Mar 7 14:26:01 1995 Yukihiro Matsumoto (matz@ix-02)

* eval.c(public/private): ������������᥽�åɤ�̾���ѹ�����Ū�ʥ�
������������褦�ˤ��Ƥߤ������Ժ��ѡ�

Mon Mar 6 19:34:32 1995 Yukihiro Matsumoto (matz@ix-02)

* eval.c(inlcude): �᥽�åɲ���ưŪ�˥⥸�塼��򥤥󥯥롼�ɤǤ�
��褦�ˡ������Ǥ�դΥ��֥������Ȥˤ�⥸�塼��򥤥󥯥롼�ɤ�
����᥽�å� `extend'���Ѱդ�����

* parse.y: ʸˡ����include�������᥽�åɲ���

Tue Feb 28 15:35:10 1995 Yukihiro Matsumoto (matz@ix-02)

* parse.y: ����Ϣ������κǸ��`,'�򤪤���褦�ˡ�

Fri Feb 24 13:15:43 1995 Yukihiro Matsumoto (matz@ix-02)

* version 0.68
Expand Down
6 changes: 2 additions & 4 deletions MANIFEST
Expand Up @@ -27,11 +27,7 @@ file.c
fnmatch.c
fnmatch.h
gc.c
getopt.c
getopt.h
getopt1.c
glob.c
gnuglob.c
ident.h
inits.c
io.c
Expand Down Expand Up @@ -62,6 +58,8 @@ st.h
string.c
struct.c
time.c
util.h
util.c
variable.c
version.c
version.h
24 changes: 12 additions & 12 deletions Makefile.in
Expand Up @@ -28,7 +28,6 @@ bindir = $(exec_prefix)/bin

HDRS = defines.h \
dln.h \
getopt.h \
ident.h \
io.h \
node.h \
Expand All @@ -54,10 +53,7 @@ OBJS = array.o \
file.o \
fnmatch.o \
gc.o \
getopt.o \
getopt1.o \
glob.o \
gnuglob.o \
inits.o \
io.o \
main.o \
Expand All @@ -79,6 +75,7 @@ OBJS = array.o \
string.o \
struct.o \
time.o \
util.o \
variable.o \
version.o \
$(MISSING)
Expand Down Expand Up @@ -142,19 +139,19 @@ array.o: array.c ruby.h config.h defines.h
bignum.o: bignum.c ruby.h config.h defines.h
class.o: class.c ruby.h config.h defines.h env.h node.h st.h
compar.o: compar.c ruby.h config.h defines.h
cons.o: cons.c ruby.h config.h defines.h
dbm.o: dbm.c ruby.h config.h defines.h
dict.o: dict.c ruby.h config.h defines.h st.h
dir.o: dir.c ruby.h config.h defines.h
dln.o: dln.c defines.h dln.h
dln.o: dln.c config.h defines.h dln.h st.h
enum.o: enum.c ruby.h config.h defines.h
error.o: error.c ruby.h config.h defines.h env.h
etc.o: etc.c ruby.h config.h defines.h
eval.o: eval.c ruby.h config.h defines.h ident.h env.h node.h st.h
file.o: file.c ruby.h config.h defines.h io.h
fnmatch.o: fnmatch.c fnmatch.h
gc.o: gc.c ruby.h config.h defines.h env.h st.h
glob.o: glob.c ruby.h config.h defines.h fnmatch.h
gnuglob.o: gnuglob.c fnmatch.h
fnmatch.o: fnmatch.c config.h fnmatch.h
gc.o: gc.c ruby.h config.h defines.h env.h st.h node.h
glob.o: glob.c config.h fnmatch.h
inits.o: inits.c ruby.h config.h defines.h
io.o: io.c ruby.h config.h defines.h io.h
main.o: main.c
Expand All @@ -166,13 +163,16 @@ process.o: process.c ruby.h config.h defines.h st.h
random.o: random.c ruby.h config.h defines.h
range.o: range.c ruby.h config.h defines.h
re.o: re.c ruby.h config.h defines.h re.h regex.h
regex.o: regex.c defines.h regex.h
ruby.o: ruby.c ruby.h config.h defines.h re.h regex.h getopt.h
regex.o: regex.c config.h defines.h regex.h util.h
ruby.o: ruby.c ruby.h config.h defines.h re.h regex.h
signal.o: signal.c ruby.h config.h defines.h
socket.o: socket.c ruby.h config.h defines.h io.h
sprintf.o: sprintf.c ruby.h config.h defines.h
st.o: st.c st.h
st.o: st.c config.h st.h
string.o: string.c ruby.h config.h defines.h re.h regex.h
struct.o: struct.c ruby.h config.h defines.h env.h
tclglob.o: tclglob.c
time.o: time.c ruby.h config.h defines.h
util.o: util.c defines.h config.h util.h
variable.o: variable.c ruby.h config.h defines.h env.h ident.h st.h
version.o: version.c ruby.h config.h defines.h version.h
6 changes: 3 additions & 3 deletions class.c
Expand Up @@ -230,15 +230,15 @@ rb_define_method(class, name, func, argc)
VALUE (*func)();
int argc;
{
rb_add_method(class, rb_intern(name), NEW_CFUNC(func, argc), 0);
rb_add_method(class, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PUBLIC);
}

void
rb_undef_method(class, name)
struct RClass *class;
char *name;
{
rb_add_method(class, rb_intern(name), Qnil, 0);
rb_add_method(class, rb_intern(name), Qnil, NOEX_PUBLIC);
}

void
Expand All @@ -248,7 +248,7 @@ rb_define_private_method(class, name, func, argc)
VALUE (*func)();
int argc;
{
rb_add_method(class, rb_intern(name), NEW_CFUNC(func, argc), 1);
rb_add_method(class, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE);
}

VALUE
Expand Down
3 changes: 2 additions & 1 deletion dict.c
Expand Up @@ -615,12 +615,13 @@ Init_Dict()
rb_define_method(C_Dict,"has_value", Fdic_has_value, 1);

envtbl = obj_alloc(C_Object);
rb_extend_object(envtbl, M_Enumerable);

rb_define_single_method(envtbl,"[]", Fgetenv, 1);
rb_define_single_method(envtbl,"[]=", Fsetenv, 2);
rb_define_single_method(envtbl,"each", Fenv_each, 0);
rb_define_single_method(envtbl,"delete", Fenv_delete, 1);
rb_define_single_method(envtbl,"to_s", Fenv_to_s, 0);
rb_include_module(CLASS_OF(envtbl), M_Enumerable);

rb_define_variable("$ENV", &envtbl, Qnil, rb_readonly_hook, 0);
rb_define_const(C_Kernel, "ENV", envtbl);
Expand Down
105 changes: 105 additions & 0 deletions dir.c
Expand Up @@ -237,6 +237,108 @@ Sdir_rmdir(obj, dir)
return TRUE;
}

#define isdelim(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)=='\0')

char **glob_filename();

static void
push_globs(ary, s)
VALUE ary;
char *s;
{
char **fnames, **ff;

fnames = glob_filename(s);
if (fnames == (char**)-1) rb_sys_fail(s);
ff = fnames;
while (*ff) {
ary_push(ary, str_new2(*ff));
free(*ff);
ff++;
}
free(fnames);
}

static int
push_braces(ary, s)
VALUE ary;
char *s;
{
char buf[MAXPATHLEN];
char *p, *t, *b;
char *lbrace, *rbrace;

p = s;
lbrace = rbrace = Qnil;
while (*p) {
if (*p == '{' && !lbrace) lbrace = p;
if (*p == '}' && lbrace) rbrace = p;
*p++;
}

if (lbrace) {
memcpy(buf, s, lbrace-s);
b = buf + (lbrace-s);
p = lbrace;
while (*p != '}') {
t = p + 1;
for (p = t; *p!='}' && *p!=','; p++) {
/* skip inner braces */
if (*p == '{') while (*p!='}') p++;
}
memcpy(b, t, p-t);
strcpy(b+(p-t), rbrace+1);
push_braces(ary, buf);
}
}
else {
push_globs(ary, s);
}
}

static VALUE
Sdir_glob(dir, str)
VALUE dir;
struct RString *str;
{
char *p, *pend;
char buf[MAXPATHLEN];
char *t, *t0;
int nest;
VALUE ary;

Check_Type(str, T_STRING);

ary = ary_new();

p = str->ptr;
pend = p + str->len;

while (p < pend) {
t = buf;
while (p < pend && isdelim(*p)) p++;
while (p < pend && !isdelim(*p)) {
*t++ = *p++;
}
*t = '\0';
t0 = buf;
nest = 0;
while (t0 < t) {
if (*t0 == '{') nest+=2;
if (*t0 == '}') nest+=3;
t0++;
}
if (nest == 0) {
push_globs(ary, buf);
}
else if (nest % 5 == 0) {
push_braces(ary, buf);
}
/* else unmatched braces */
}
return ary;
}

Init_Dir()
{
extern VALUE M_Enumerable;
Expand All @@ -261,4 +363,7 @@ Init_Dir()
rb_define_single_method(C_Dir,"rmdir", Sdir_rmdir, 1);
rb_define_single_method(C_Dir,"delete", Sdir_rmdir, 1);
rb_define_single_method(C_Dir,"unlink", Sdir_rmdir, 1);

rb_define_single_method(C_Dir,"glob", Sdir_glob, 1);
rb_define_single_method(C_Dir,"[]", Sdir_glob, 1);
}
3 changes: 3 additions & 0 deletions env.h
Expand Up @@ -32,4 +32,7 @@ extern int rb_in_eval;

extern struct RClass *the_class;

#define NOEX_PUBLIC 0
#define NOEX_PRIVATE 1

#endif /* ENV_H */
9 changes: 7 additions & 2 deletions error.c
Expand Up @@ -25,8 +25,13 @@ err_sprintf(buf, fmt, args)
char *buf, *fmt;
va_list args;
{
sprintf(buf, "%s:%d: ", sourcefile, sourceline);
vsprintf((char*)buf+strlen(buf), fmt, args);
if (!sourcefile) {
vsprintf(buf, fmt, args);
}
else {
sprintf(buf, "%s:%d: ", sourcefile, sourceline);
vsprintf((char*)buf+strlen(buf), fmt, args);
}
if (buf[strlen(buf)-1] != '\n')
strcat(buf, "\n");
}
Expand Down
15 changes: 8 additions & 7 deletions etc.c
Expand Up @@ -179,14 +179,15 @@ VALUE M_Etc;
Init_Etc()
{
M_Etc = rb_define_module("Etc");
rb_extend_object(M_Etc, M_Etc);

rb_define_module_function(M_Etc, "getlogin", Fetc_getlogin, 0);
rb_define_method(M_Etc, "getlogin", Fetc_getlogin, 0);

rb_define_module_function(M_Etc, "getpwuid", Fetc_getpwuid, -1);
rb_define_module_function(M_Etc, "getpwnam", Fetc_getpwnam, 1);
rb_define_module_function(M_Etc, "passwd", Fetc_passwd, 0);
rb_define_method(M_Etc, "getpwuid", Fetc_getpwuid, -1);
rb_define_method(M_Etc, "getpwnam", Fetc_getpwnam, 1);
rb_define_method(M_Etc, "passwd", Fetc_passwd, 0);

rb_define_module_function(M_Etc, "getgrgid", Fetc_getgrgid, 1);
rb_define_module_function(M_Etc, "getgrnam", Fetc_getgrnam, 1);
rb_define_module_function(M_Etc, "group", Fetc_group, 0);
rb_define_method(M_Etc, "getgrgid", Fetc_getgrgid, 1);
rb_define_method(M_Etc, "getgrnam", Fetc_getgrnam, 1);
rb_define_method(M_Etc, "group", Fetc_group, 0);
}

0 comments on commit d349889

Please sign in to comment.