1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

prepare to alpha

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-04-16 06:03:36 +00:00
parent f96faa860b
commit bcab5ca9d1
14 changed files with 435 additions and 334 deletions

View file

@ -1,3 +1,28 @@
Thu Apr 15 23:46:20 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
* ruby.c (rubylib_mangle): mangle path by RUBYLIB_PREFIX.
Wed Apr 14 23:52:51 1999 SHIROYAMA Takayuki <psi@tokyo.stellar.co.jp>
* node.h (NODE_LMASK): should be long to avoid overflow.
Wed Apr 14 12:19:09 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* lib/thread.rb: Queue#{enq,deq} added.
Tue Apr 13 17:43:56 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* hash.c (rb_hash_s_create): Hash::[] acts more like casting.
Tue Apr 13 00:33:52 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_io_stdio_set): warning for assignment to the variables
$std{in,out,err}.
Mon Apr 12 23:12:32 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_io_reopen): check for reopening same IO.
Fri Apr 9 17:45:11 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (rb_compile_string): bug for nested eval().

2
config.sub vendored
View file

@ -723,7 +723,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux* | -uxpv* | -beos*)
| -mingw32* | -linux* | -uxpv* | -beos* | -rhapsody* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)

2
eval.c
View file

@ -4252,7 +4252,7 @@ rb_f_eval(argc, argv, self)
}
Check_SafeStr(src);
return eval(self, src, scope, file, line-1);
return eval(self, src, scope, file, line);
}
static VALUE

View file

@ -3,5 +3,5 @@ depend
extconf.rb
lib/kconv.rb
nkf.c
1.7/nkf.c
nkf1.7/nkf.c
test.rb

View file

@ -535,14 +535,12 @@ thread_connect(fd, sockaddr, len, type)
}
if (status < 0) {
switch (errno) {
#ifdef EINPROGRESS
case EINPROGRESS:
#ifdef EAGAIN
case EAGAIN:
#ifdef EINPROGRESS
case EINPROGRESS:
#endif
FD_ZERO(&fds);
FD_SET(fd, &fds);
rb_thread_select(fd+1, 0, &fds, 0, 0);
rb_thread_fd_writable(fd);
continue;
#endif

24
hash.c
View file

@ -241,17 +241,23 @@ rb_hash_s_create(argc, argv, klass)
VALUE hash;
int i;
if (argc == 1 && TYPE(argv[0]) == T_HASH) {
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
if (argc == 1) {
if (TYPE(argv[0]) == T_HASH) {
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
hash->iter_lev = 0;
hash->ifnone = Qnil;
hash->tbl = 0; /* avoid GC crashing */
hash->tbl = (st_table*)st_copy(RHASH(argv[0])->tbl);
rb_obj_call_init((VALUE)hash, argc, argv);
hash->iter_lev = 0;
hash->ifnone = Qnil;
hash->tbl = 0; /* avoid GC crashing */
hash->tbl = st_copy(RHASH(argv[0])->tbl);
rb_obj_call_init((VALUE)hash, argc, argv);
return (VALUE)hash;
return (VALUE)hash;
}
else {
VALUE a = rb_Array(argv[0]);
return rb_hash_s_create(RARRAY(a)->len, RARRAY(a)->ptr, klass);
}
}
if (argc % 2 != 0) {

4
io.c
View file

@ -1607,6 +1607,7 @@ rb_io_reopen(io, nfile)
nfile = rb_io_get_io(nfile);
GetOpenFile(nfile, orig);
if (fptr == orig) return io;
if (orig->f2) {
fflush(orig->f2);
}
@ -1999,6 +2000,9 @@ rb_io_stdio_set(val, id, var)
if (TYPE(val) != T_FILE) {
rb_raise(rb_eTypeError, "%s must be IO object", rb_id2name(id));
}
if (ruby_verbose) {
rb_warn("assignment for %s is done by reopen", rb_id2name(id));
}
GetOpenFile(*var, fptr);
fd = fileno(fptr->f);
GetOpenFile(val, fptr);

View file

@ -2,7 +2,7 @@
= simple telnet cliant library
telnet.rb ver0.162 1999/03/18
telnet.rb ver0.163 1999/04/11
Wakou Aoyama <wakou@fsinet.or.jp>
@ -30,6 +30,17 @@ if set "Telnetmode" option FALSE. not TELNET command interpretation.
the same character as "Prompt" is included in the data, and, when
the network or the host is very heavy, the value is enlarged.
=== status output
host = Telnet.new({"Hosh" => "localhost"){|c| print c }
connection status output.
example
Trying localhost...
Connected to localhost.
== waitfor (wait for match)
@ -133,6 +144,9 @@ of cource, set sync=TRUE or flush is necessary.
= history
ver0.163 1999/04/11
STDOUT.write(message) --> yield(message) if iterator?
ver0.162 1999/03/17
add "Proxy" option
required timeout.rb
@ -291,7 +305,7 @@ class Telnet < SimpleDelegator
end
else
message = "Trying " + @options["Host"] + "...\n"
STDOUT.write(message)
yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
@ -310,7 +324,7 @@ class Telnet < SimpleDelegator
@sock.binmode
message = "Connected to " + @options["Host"] + ".\n"
STDOUT.write(message)
yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
end

View file

@ -120,6 +120,7 @@ class Queue
Thread.critical = false
t.run if t
end
alias enq push
def pop non_block=false
Thread.critical = true
@ -139,6 +140,8 @@ class Queue
Thread.critical = false
end
end
alias shift pop
alias deq pop
def empty?
@que.length == 0

2
node.h
View file

@ -144,7 +144,7 @@ typedef struct RNode {
RNODE(n)->flags=((RNODE(n)->flags&~FL_UMASK)|(((t)<<FL_USHIFT)&FL_UMASK))
#define NODE_LSHIFT (FL_USHIFT+8)
#define NODE_LMASK ((1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
#define NODE_LMASK (((long)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
#define nd_line(n) (((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK)
#define nd_set_line(n,l) \
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))

591
parse.c

File diff suppressed because it is too large Load diff

21
regex.c
View file

@ -3102,14 +3102,15 @@ typedef union
*stackp++ = (unsigned char*)0; /* non-greedy flag */ \
} while(0)
#define NON_GREEDY ((unsigned char*)1)
/* This pops what PUSH_FAILURE_POINT pushes. */
#define POP_FAILURE_POINT() \
do { \
int temp; \
long temp; \
stackp -= NUM_NONREG_ITEMS; /* Remove failure points (and flag). */ \
temp = (int)*--stackp; /* How many regs pushed. */ \
temp = (long)*--stackp; /* How many regs pushed. */ \
temp *= NUM_REG_ITEMS; /* How much to take off the stack. */ \
stackp -= temp; /* Remove the register info. */ \
} while(0)
@ -3320,7 +3321,7 @@ re_match(bufp, string_arg, size, pos, regs)
if (p == pend) {
/* If not end of string, try backtracking. Otherwise done. */
if (d != dend) {
while (stackp != stackb && (int)stackp[-1] == 1) {
while (stackp != stackb && stackp[-1] == NON_GREEDY) {
if (best_regs_set) /* non-greedy, no need to backtrack */
goto restore_best_regs;
POP_FAILURE_POINT();
@ -3462,7 +3463,7 @@ re_match(bufp, string_arg, size, pos, regs)
regstart[r] = old_regstart[r];
/* xx why this test? */
if ((int)old_regend[r] >= (int)regstart[r])
if ((long)old_regend[r] >= (long)regstart[r])
regend[r] = old_regend[r];
}
}
@ -3805,7 +3806,7 @@ re_match(bufp, string_arg, size, pos, regs)
EXTRACT_NUMBER_AND_INCR(mcnt, p);
if (p + mcnt < pend) {
PUSH_FAILURE_POINT(p, d);
stackp[-1] = (unsigned char*)1;
stackp[-1] = NON_GREEDY;
}
p += mcnt;
continue;
@ -3814,7 +3815,7 @@ re_match(bufp, string_arg, size, pos, regs)
POP_FAILURE_POINT();
EXTRACT_NUMBER_AND_INCR(mcnt, p);
PUSH_FAILURE_POINT(p + mcnt, d);
stackp[-1] = (unsigned char*)1;
stackp[-1] = NON_GREEDY;
continue;
case finalize_push_n:
@ -3831,7 +3832,7 @@ re_match(bufp, string_arg, size, pos, regs)
POP_FAILURE_POINT();
EXTRACT_NUMBER_AND_INCR(mcnt, p);
PUSH_FAILURE_POINT(p + mcnt, d);
stackp[-1] = (unsigned char*)1;
stackp[-1] = NON_GREEDY;
p += 2; /* skip n */
}
/* If don't have to push any more, skip over the rest of command. */
@ -3967,10 +3968,6 @@ re_match(bufp, string_arg, size, pos, regs)
SET_REGS_MATCHED;
break;
}
#if 0
while (stackp != stackb && (int)stackp[-1] == 1)
POP_FAILURE_POINT();
#endif
continue; /* Successfully executed one pattern command; keep going. */
/* Jump here if any matching operation fails. */
@ -3981,7 +3978,7 @@ re_match(bufp, string_arg, size, pos, regs)
/* If this failure point is from a dummy_failure_point, just
skip it. */
if (stackp[-3] == 0 || (best_regs_set && (int)stackp[-1] == 1)) {
if (stackp[-3] == 0 || (best_regs_set && stackp[-1] == NON_GREEDY)) {
POP_FAILURE_POINT();
goto fail;
}

63
ruby.c
View file

@ -124,6 +124,63 @@ extern VALUE rb_load_path;
static FILE *e_fp;
static char *e_tmpname;
#define STATIC_FILE_LENGTH 255
#if defined(_WIN32) || defined(DJGPP)
static char *
rubylib_mangle(s, l)
char *s;
unsigned int l;
{
static char *newp, *oldp;
static int newl, oldl, notfound;
static char ret[STATIC_FILE_LENGTH+1];
if (!newp && !notfound) {
newp = getenv("RUBYLIB_PREFIX");
if (newp) {
char *s;
oldp = newp;
while (*newp && !ISSPACE(*newp) && *newp != ';') {
newp++; oldl++; /* Skip digits. */
}
while (*newp && (ISSPACE(*newp) || *newp == ';')) {
newp++; /* Skip whitespace. */
}
newl = strlen(newp);
if (newl == 0 || oldl == 0) {
Fatal("malformed RUBYLIB_PREFIX");
}
strcpy(ret, newp);
s = ret;
while (*s) {
if (*s == '\\') *s = '/';
s++;
}
} else {
notfound = 1;
}
}
if (!newp) {
return s;
}
if (l == 0) {
l = strlen(s);
}
if (l < oldl || strncasecmp(oldp, s, oldl) != 0) {
return s;
}
if (l + newl - oldl > STATIC_FILE_LENGTH || newl > STATIC_FILE_LENGTH) {
Fatal("malformed RUBYLIB_PREFIX");
}
strcpy(ret + newl, s + oldl);
return ret;
}
#else
#define rubylib_mangle(s, l) (s)
#endif
static void
addpath(path)
const char *path;
@ -146,18 +203,18 @@ addpath(path)
while (*p) {
while (*p == sep) p++;
if (s = strchr(p, sep)) {
rb_ary_push(ary, rb_str_new(p, (int)(s-p)));
rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, (int)(s-p))));
p = s + 1;
}
else {
rb_ary_push(ary, rb_str_new2(p));
rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, 0)));
break;
}
}
rb_load_path = rb_ary_plus(ary, rb_load_path);
}
else {
rb_ary_unshift(rb_load_path, rb_str_new2(path));
rb_ary_unshift(rb_load_path, rb_str_new2(rubylib_mangle(path, 0)));
}
}

View file

@ -1,2 +1,2 @@
#define RUBY_VERSION "1.3.2"
#define RUBY_RELEASE_DATE "1999-04-08"
#define RUBY_RELEASE_DATE "1999-04-13"