зеркало из https://github.com/github/ruby.git
* parse.y (primary): allow no "when" case. [ruby-dev:22578]
* ruby.h (rb_class_of): reduce branch. [ruby-dev:22577] * ruby.h (rb_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
47c7c5bac6
Коммит
6760a5ed9f
|
@ -1,3 +1,11 @@
|
|||
Tue Jan 13 14:48:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y (primary): allow no "when" case. [ruby-dev:22578]
|
||||
|
||||
* ruby.h (rb_class_of): reduce branch. [ruby-dev:22577]
|
||||
|
||||
* ruby.h (rb_type): ditto.
|
||||
|
||||
Tue Jan 13 14:26:59 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||
|
||||
* lib/test/unit/ui/testrunnerutilities.rb (TestRunnerUtilities):
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
# - #owned?
|
||||
# - #pipe?
|
||||
# - #readable?
|
||||
# - #world_readable?
|
||||
# - #readable_real?
|
||||
# - #setgid?
|
||||
# - #setuid?
|
||||
|
@ -112,6 +113,7 @@
|
|||
# - #sticky?
|
||||
# - #symlink?
|
||||
# - #writable?
|
||||
# - #world_writable?
|
||||
# - #writable_real?
|
||||
# - #zero?
|
||||
#
|
||||
|
@ -717,6 +719,9 @@ class Pathname # * FileTest *
|
|||
# See <tt>FileTest.readable?</tt>.
|
||||
def readable?() FileTest.readable?(@path) end
|
||||
|
||||
# See <tt>FileTest.readable_world?</tt>.
|
||||
def readable_world?() FileTest.readable_world?(@path) end
|
||||
|
||||
# See <tt>FileTest.readable_real?</tt>.
|
||||
def readable_real?() FileTest.readable_real?(@path) end
|
||||
|
||||
|
@ -741,6 +746,9 @@ class Pathname # * FileTest *
|
|||
# See <tt>FileTest.writable?</tt>.
|
||||
def writable?() FileTest.writable?(@path) end
|
||||
|
||||
# See <tt>FileTest.writable_world?</tt>.
|
||||
def writable_world?() FileTest.writable_world?(@path) end
|
||||
|
||||
# See <tt>FileTest.writable_real?</tt>.
|
||||
def writable_real?() FileTest.writable_real?(@path) end
|
||||
|
||||
|
|
4
parse.y
4
parse.y
|
@ -1565,6 +1565,10 @@ primary : literal
|
|||
$$ = NEW_CASE($2, $4);
|
||||
fixpos($$, $2);
|
||||
}
|
||||
| kCASE expr_value opt_terms kELSE compstmt kEND
|
||||
{
|
||||
$$ = block_append($2, $5);
|
||||
}
|
||||
| kCASE opt_terms case_body kEND
|
||||
{
|
||||
$$ = $3;
|
||||
|
|
23
ruby.h
23
ruby.h
|
@ -629,14 +629,19 @@ rb_class_of(obj)
|
|||
VALUE obj;
|
||||
#endif
|
||||
{
|
||||
if(IMMEDIATE_P(obj)){
|
||||
if (FIXNUM_P(obj)) return rb_cFixnum;
|
||||
if (obj == Qnil) return rb_cNilClass;
|
||||
if (obj == Qfalse) return rb_cFalseClass;
|
||||
if (obj == Qtrue) return rb_cTrueClass;
|
||||
if (SYMBOL_P(obj)) return rb_cSymbol;
|
||||
|
||||
}
|
||||
else if(!RTEST(obj)){
|
||||
if (obj == Qnil) return rb_cNilClass;
|
||||
if (obj == Qfalse) return rb_cFalseClass;
|
||||
}
|
||||
else{
|
||||
return RBASIC(obj)->klass;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
#if defined(HAVE_PROTOTYPES)
|
||||
|
@ -646,14 +651,20 @@ rb_type(obj)
|
|||
VALUE obj;
|
||||
#endif
|
||||
{
|
||||
if(IMMEDIATE_P(obj)){
|
||||
if (FIXNUM_P(obj)) return T_FIXNUM;
|
||||
if (obj == Qtrue) return T_TRUE;
|
||||
if (SYMBOL_P(obj)) return T_SYMBOL;
|
||||
if (obj == Qundef) return T_UNDEF;
|
||||
}
|
||||
else if(!RTEST(obj)){
|
||||
if (obj == Qnil) return T_NIL;
|
||||
if (obj == Qfalse) return T_FALSE;
|
||||
if (obj == Qtrue) return T_TRUE;
|
||||
if (obj == Qundef) return T_UNDEF;
|
||||
if (SYMBOL_P(obj)) return T_SYMBOL;
|
||||
}
|
||||
else{
|
||||
return BUILTIN_TYPE(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
#if defined(HAVE_PROTOTYPES)
|
||||
|
|
Загрузка…
Ссылка в новой задаче