matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
db1571b1b4
commit
764c6a285e
29
ChangeLog
29
ChangeLog
@ -1,14 +1,39 @@
|
|||||||
|
Mon Sep 4 12:58:31 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* stable version 1.6.0 released.
|
||||||
|
|
||||||
Mon Sep 4 13:40:40 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
Mon Sep 4 13:40:40 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
|
||||||
|
|
||||||
* configure.in: renamed libruby.a to libruby.{cygwin,mingw32}.a
|
* configure.in: renamed libruby.a to libruby.{cygwin,mingw32}.a
|
||||||
on cygwin and mingw32.
|
on cygwin and mingw32.
|
||||||
|
|
||||||
Fri Sep 1 10:36:45 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sun Sep 3 23:44:04 2000 Noriaki Harada <tenmei@maoh.office.ne.jp>
|
||||||
|
|
||||||
* stable version 1.6.0 released.
|
* io.c (NO_SAFE_RENAME): for BeOS too.
|
||||||
|
|
||||||
|
Sun Sep 3 11:31:53 2000 Takaaki Tateishi <ttate@jaist.ac.jp>
|
||||||
|
|
||||||
|
* parse.y (rescue): no assignment was done if rescue body as
|
||||||
|
empty.
|
||||||
|
|
||||||
|
Sat Sep 2 10:52:21 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (call_args,aref_args): block_call can be the last
|
||||||
|
argument.
|
||||||
|
|
||||||
|
* parse.y (COND_PUSH,COND_POP): maintain condition stack to allow
|
||||||
|
kDO2 in parentheses in while/until/for conditions.
|
||||||
|
|
||||||
|
* parse.y (yylex): generate kDO2 for EXPR_ARG outside of
|
||||||
|
while/until/for condition.
|
||||||
|
|
||||||
Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (aref_args,opt_call_args): add block_call to allow a
|
||||||
|
method without parentheses and with block as a last argument.
|
||||||
|
|
||||||
|
* hash.c (rb_hash_sort): should not retrun nil.
|
||||||
|
|
||||||
* re.c (match_aref): should use rb_reg_nth_match().
|
* re.c (match_aref): should use rb_reg_nth_match().
|
||||||
|
|
||||||
* eval.c (POP_SCOPE): recycled scopes too much
|
* eval.c (POP_SCOPE): recycled scopes too much
|
||||||
|
@ -191,7 +191,7 @@ Public License)
|
|||||||
|
|
||||||
* Ãø¼Ô
|
* Ãø¼Ô
|
||||||
|
|
||||||
コメント,バグレポートその他は matz@zetabis.com まで.
|
コメント,バグレポートその他は matz@zetabits.com まで.
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
created at: Thu Aug 3 11:57:36 JST 1995
|
created at: Thu Aug 3 11:57:36 JST 1995
|
||||||
Local variables:
|
Local variables:
|
||||||
|
4
hash.c
4
hash.c
@ -613,7 +613,9 @@ static VALUE
|
|||||||
rb_hash_sort(hash)
|
rb_hash_sort(hash)
|
||||||
VALUE hash;
|
VALUE hash;
|
||||||
{
|
{
|
||||||
return rb_ary_sort_bang(rb_hash_to_a(hash));
|
VALUE entries = rb_hash_to_a(hash);
|
||||||
|
rb_ary_sort_bang(entries);
|
||||||
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
2
io.c
2
io.c
@ -19,7 +19,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__)
|
#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__)
|
||||||
# define NO_SAFE_RENAME
|
# define NO_SAFE_RENAME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
58
parse.y
58
parse.y
@ -58,6 +58,17 @@ static enum lex_state {
|
|||||||
} lex_state;
|
} lex_state;
|
||||||
|
|
||||||
static int cond_nest = 0;
|
static int cond_nest = 0;
|
||||||
|
static unsigned long cond_stack = 0;
|
||||||
|
#define COND_PUSH do {\
|
||||||
|
cond_nest++;\
|
||||||
|
cond_stack = (cond_stack<<1)|1;\
|
||||||
|
} while(0)
|
||||||
|
#define COND_POP do {\
|
||||||
|
cond_nest--;\
|
||||||
|
cond_stack >>= 1;\
|
||||||
|
} while (0)
|
||||||
|
#define IN_COND (cond_nest > 0 && (cond_stack&1))
|
||||||
|
|
||||||
static int class_nest = 0;
|
static int class_nest = 0;
|
||||||
static int in_single = 0;
|
static int in_single = 0;
|
||||||
static int compile_for_eval = 0;
|
static int compile_for_eval = 0;
|
||||||
@ -214,8 +225,6 @@ static void top_local_setup();
|
|||||||
* precedence table
|
* precedence table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%nonassoc kDO
|
|
||||||
%nonassoc kDO2*/
|
|
||||||
%left kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD kRESCUE_MOD
|
%left kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD kRESCUE_MOD
|
||||||
%left kOR kAND
|
%left kOR kAND
|
||||||
%right kNOT
|
%right kNOT
|
||||||
@ -859,15 +868,19 @@ aref_args : none
|
|||||||
{
|
{
|
||||||
$$ = NEW_LIST($1);
|
$$ = NEW_LIST($1);
|
||||||
}
|
}
|
||||||
|
| args ',' command_call opt_nl
|
||||||
|
{
|
||||||
|
$$ = list_append($1, $3);
|
||||||
|
}
|
||||||
| block_call opt_nl
|
| block_call opt_nl
|
||||||
{
|
{
|
||||||
$$ = NEW_LIST($1);
|
$$ = NEW_LIST($1);
|
||||||
}
|
}
|
||||||
| args opt_nl
|
| args ',' block_call opt_nl
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = list_append($1, $3);
|
||||||
}
|
}
|
||||||
| args ',' opt_nl
|
| args trailer
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
@ -876,11 +889,7 @@ aref_args : none
|
|||||||
value_expr($4);
|
value_expr($4);
|
||||||
$$ = arg_concat($1, $4);
|
$$ = arg_concat($1, $4);
|
||||||
}
|
}
|
||||||
| assocs
|
| assocs trailer
|
||||||
{
|
|
||||||
$$ = NEW_LIST(NEW_HASH($1));
|
|
||||||
}
|
|
||||||
| assocs ','
|
|
||||||
{
|
{
|
||||||
$$ = NEW_LIST(NEW_HASH($1));
|
$$ = NEW_LIST(NEW_HASH($1));
|
||||||
}
|
}
|
||||||
@ -896,6 +905,10 @@ opt_call_args : none
|
|||||||
{
|
{
|
||||||
$$ = NEW_LIST($1);
|
$$ = NEW_LIST($1);
|
||||||
}
|
}
|
||||||
|
| args ',' block_call
|
||||||
|
{
|
||||||
|
$$ = list_append($1, $3);
|
||||||
|
}
|
||||||
|
|
||||||
call_args : command_call
|
call_args : command_call
|
||||||
{
|
{
|
||||||
@ -1152,7 +1165,7 @@ primary : literal
|
|||||||
$$ = NEW_UNLESS(cond($2), $4, $5);
|
$$ = NEW_UNLESS(cond($2), $4, $5);
|
||||||
fixpos($$, $2);
|
fixpos($$, $2);
|
||||||
}
|
}
|
||||||
| kWHILE {cond_nest++;} expr do { cond_nest--; }
|
| kWHILE {COND_PUSH;} expr do {COND_POP;}
|
||||||
compstmt
|
compstmt
|
||||||
kEND
|
kEND
|
||||||
{
|
{
|
||||||
@ -1160,7 +1173,7 @@ primary : literal
|
|||||||
$$ = NEW_WHILE(cond($3), $6, 1);
|
$$ = NEW_WHILE(cond($3), $6, 1);
|
||||||
fixpos($$, $3);
|
fixpos($$, $3);
|
||||||
}
|
}
|
||||||
| kUNTIL {cond_nest++;} expr do { cond_nest--; }
|
| kUNTIL {COND_PUSH;} expr do {COND_POP;}
|
||||||
compstmt
|
compstmt
|
||||||
kEND
|
kEND
|
||||||
{
|
{
|
||||||
@ -1176,7 +1189,7 @@ primary : literal
|
|||||||
$$ = NEW_CASE($2, $3);
|
$$ = NEW_CASE($2, $3);
|
||||||
fixpos($$, $2);
|
fixpos($$, $2);
|
||||||
}
|
}
|
||||||
| kFOR block_var kIN {cond_nest++;} expr do {cond_nest--;}
|
| kFOR block_var kIN {COND_PUSH;} expr do {COND_POP;}
|
||||||
compstmt
|
compstmt
|
||||||
kEND
|
kEND
|
||||||
{
|
{
|
||||||
@ -1442,8 +1455,7 @@ method_call : operation '(' opt_call_args close_paren
|
|||||||
|
|
||||||
close_paren : ')'
|
close_paren : ')'
|
||||||
{
|
{
|
||||||
if (cond_nest == 0)
|
if (!IN_COND) lex_state = EXPR_PAREN;
|
||||||
lex_state = EXPR_PAREN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt_rhs : block_call
|
stmt_rhs : block_call
|
||||||
@ -1484,7 +1496,7 @@ rescue : kRESCUE exc_list exc_var then
|
|||||||
compstmt
|
compstmt
|
||||||
rescue
|
rescue
|
||||||
{
|
{
|
||||||
if ($3 && $5) {
|
if ($3) {
|
||||||
$3 = node_assign($3, NEW_GVAR(rb_intern("$!")));
|
$3 = node_assign($3, NEW_GVAR(rb_intern("$!")));
|
||||||
$5 = block_append($3, $5);
|
$5 = block_append($3, $5);
|
||||||
}
|
}
|
||||||
@ -1908,6 +1920,7 @@ yycompile(f, line)
|
|||||||
rb_gc();
|
rb_gc();
|
||||||
ruby_in_compile = 0;
|
ruby_in_compile = 0;
|
||||||
cond_nest = 0;
|
cond_nest = 0;
|
||||||
|
cond_stack = 0;
|
||||||
class_nest = 0;
|
class_nest = 0;
|
||||||
in_single = 0;
|
in_single = 0;
|
||||||
cur_mid = 0;
|
cur_mid = 0;
|
||||||
@ -3198,7 +3211,13 @@ yylex()
|
|||||||
|
|
||||||
case ']':
|
case ']':
|
||||||
case '}':
|
case '}':
|
||||||
|
lex_state = EXPR_END;
|
||||||
|
return c;
|
||||||
|
|
||||||
case ')':
|
case ')':
|
||||||
|
if (cond_nest > 0) {
|
||||||
|
cond_stack >>= 1;
|
||||||
|
}
|
||||||
lex_state = EXPR_END;
|
lex_state = EXPR_END;
|
||||||
return c;
|
return c;
|
||||||
|
|
||||||
@ -3264,6 +3283,9 @@ yylex()
|
|||||||
return '~';
|
return '~';
|
||||||
|
|
||||||
case '(':
|
case '(':
|
||||||
|
if (cond_nest > 0) {
|
||||||
|
cond_stack = (cond_stack<<1)|0;
|
||||||
|
}
|
||||||
if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
|
if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
|
||||||
c = tLPAREN;
|
c = tLPAREN;
|
||||||
}
|
}
|
||||||
@ -3513,7 +3535,9 @@ yylex()
|
|||||||
if (state == EXPR_FNAME) {
|
if (state == EXPR_FNAME) {
|
||||||
yylval.id = rb_intern(kw->name);
|
yylval.id = rb_intern(kw->name);
|
||||||
}
|
}
|
||||||
if (state == EXPR_PAREN && kw->id[0] == kDO) {
|
if (kw->id[0] == kDO &&
|
||||||
|
(state == EXPR_PAREN ||
|
||||||
|
(!IN_COND && state == EXPR_ARG))) {
|
||||||
return kDO2;
|
return kDO2;
|
||||||
}
|
}
|
||||||
return kw->id[state != EXPR_BEG];
|
return kw->id[state != EXPR_BEG];
|
||||||
|
6
ruby.1
6
ruby.1
@ -1,6 +1,6 @@
|
|||||||
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.co.jp>.
|
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@zetabits.com>.
|
||||||
.na
|
.na
|
||||||
.TH RUBY 1 "ruby 1.5" "5/Nov/99" "Ruby Programmers Reference Guide"
|
.TH RUBY 1 "ruby 1.6" "2000-09-04" "Ruby Programmers Reference Guide"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ruby - Interpreted object-oriented scripting language
|
ruby - Interpreted object-oriented scripting language
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -288,4 +288,4 @@ state messages during compiling scripts. You don't have to specify
|
|||||||
this switch, unless you are going to debug the Ruby interpreter.
|
this switch, unless you are going to debug the Ruby interpreter.
|
||||||
.PP
|
.PP
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Ruby is designed and implemented by Yukihiro Matsumoto <matz@netlab.co.jp>.
|
Ruby is designed and implemented by Yukihiro Matsumoto <matz@zetabits.com>.
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#define RSHIFT(x,y) ((x)>>y)
|
#define RSHIFT(x,y) ((x)>>y)
|
||||||
#define FILE_COUNT _cnt
|
#define FILE_COUNT _cnt
|
||||||
|
#define DEFAULT_KCODE KCODE_NONE
|
||||||
#define DLEXT ".so"
|
#define DLEXT ".so"
|
||||||
#define DLEXT2 ".dll"
|
#define DLEXT2 ".dll"
|
||||||
#define RUBY_LIB "/lib/ruby/1.6"
|
#define RUBY_LIB "/lib/ruby/1.6"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user