Граф коммитов

112 Коммитов

Автор SHA1 Сообщение Дата
matz 22c005569b * variable.c (rb_set_class_path): do not set path if
* lib/cgi.rb (CGI::QueryExtension): give extended string, not a
  delegater object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-19 09:19:31 +00:00
dave d993e38f18 Add RDoc for Kernel global functions, tidy array and error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-29 03:56:22 +00:00
dave 3c288b427d Add RDoc documentation for stuff in object.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-28 06:33:07 +00:00
matz 6212cfb9c5 * gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.

* marshal.c (w_extended): singleton methods should not be checked
  when dumping via marshal_dump() or _dump(). [ruby-talk:85909]

* file.c (getcwdofdrv): avoid using getcwd() directly, use
  my_getcwd() instead.

* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
  <sunshine@sunshineco.com>.  [ruby-core:01596]

* marshal.c (w_object): LINK check earlier than anything else,
  i.e. do not dump TYPE_IVAR for already dumped objects.
  (ruby-bugs PR#1220)

* eval.c (rb_eval): call "inherited" only when a new class is
  generated; not on reopening.

* eval.c (eval): prepend error position in evaluating string to

* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
  had become unbuildable; enhanced --enable-fat-binary option so that
  it accepts a list of desired architectures (rather than assuming a
  fixed list), or defaults to a platform-appropriate list if user does
  not provide an explicit list; made the default list of architectures
  for MAB (fat binary) more comprehensive; now uses -fno-common even
  when building the interpreter (in addition to using it for
  extensions), thus allowing the interpreter to be embedded into a
  plugin module of an external project (in addition to allowing
  embedding directly into an application); added checks for
  <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
  ensures that -I/usr/local/include is employed when extensions'
  extconf.rb scripts invoke have_header() since extension checks on
  NextStep and OpenStep will fail without it if the desired resource
  resides in the /usr/local tree; fixed formatting of --help message.

* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
  invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
  (see configure's --enable-fat-binary option); added rule for new
  missing/getcwd.c.

* defines.h: fixed endian handling during MAB build (see configure's
  --enable-fat-binary option) to ensure that all portions of the
  project see the correct WORDS_BIGENDIAN value (some extension modules
  were getting the wrong endian setting); added missing constants
  GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
  and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
  define in NeXT section.

* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
  NextStep since, on some installations, this value always resolves
  uselessly to zero.

* dln.c: added error reporting to NextStep extension loader since the
  previous behavior of failing silently was not useful; now ensures
  that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
  for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
  on Rhapsody since this header lacks multiple-include protection,
  which resulted in "redefinition" compilation errors.

* main.c: also create hard reference to objc_msgSend() on NeXT
  platforms (in addition to Apple platforms).

* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
  makefiles so that extensions can be built MAB (see configure's
  --enable-fat-binary option); also utilize XCFLAGS in cc_command()
  (but not cpp_command() because MAB flags are incompatible with
  direct invocation of `cpp').

* ext/curses/extconf.rb: now additionally checks for presence of these
  curses functions which are not present on NextStep or Openstep:
  bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
  setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
  wscrl(), wsetscrreg()

* ext/curses/curses.c: added appropriate #ifdef's for additional set of
  curses functions now checked by extconf.rb; fixed curses_bkgd() and
  window_bkgd() to correctly return boolean result rather than numeric
  result; fixed window_getbkgd() to correctly signal an error by
  returning nil rather than -1.

* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
  pointers before invoking rb_tainted_str_new2() upon fields extracted
  from `struct passwd' and `struct group' since null pointers in some
  fields are common on NextStep/OpenStep (especially so for the
  `pw_comment' field) and rb_tainted_str_new2() throws an exception
  when it receives a null pointer.

* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().

* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
  gethostbyaddr(), and gethostbyname() from (const char*) to non-const
  (char*) for older platforms such as NextStep and OpenStep.

* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup(); include
  <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
  argument of gethostbyaddr() and getservbyname() from (const char*) to
  non-const (char*) for older platforms.

* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 04:00:03 +00:00
nobu 4de0bb549b * eval.c (rb_feature_p): match by classified suffix.
* eval.c (rb_require_safe): require library in the specified safe
  level.

* variable.c (rb_autoload, rb_autoload_load): restore safe level
  when autoload was called.  [ruby-dev:21338]

* intern.h: prototypes; rb_require_safe.

* test/runner.rb: accept non-option arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-13 14:57:36 +00:00
matz 90a88ab9a0 * marshal.c (r_object0): remove unnecessary iv restoration for
USRMARSHAL. [ruby-dev:21582]

* marshal.c (w_object): dump generic instance variables from
  a string from '_dump'.

* variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
  is not set.

* time.c (time_dump): copy instance variables to dumped string, to
  be included in the marshaled data.

* bignum.c (rb_big2ulong): add range check to ensure round trip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 17:45:53 +00:00
nobu 83740fa4bd * variable.c (rb_const_defined_0): look up constants in Object as
well.  [ruby-dev:21458]

* test/ruby/test_defined.rb (TestDefined::test_defined): test for
  constants.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02 03:00:23 +00:00
matz f5a7147634 * variable.c (rb_const_defined_at): should exclude constants from
Object when TYPE(klass) == T_MODULE *and* exclude is on.
  [ruby-dev:21458]

* variable.c (rb_const_get_0): do not lookup constants from Object
  when TYPE(klass) == T_MODULE *and* exclude is on.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-01 16:06:19 +00:00
matz fc8e62d0df * bignum.c (rb_big_and): convert argument using 'to_int'.
* bignum.c (rb_big_or): ditto.

* bignum.c (rb_big_xor): ditto.

* eval.c (rb_f_require): allow "require" on $SAFE>0, if feature
  name is not tainted.

* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream):
  Supports StringIO.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-12 03:16:31 +00:00
matz 8e9fbbf6d6 * eval.c (struct BLOCK): remove BLOCKTAG, use scope instead.
* eval.c (POP_TAG): no longer propagate retval.  retval is now set
  directly by localjump_destination().

* eval.c (localjump_destination): new function to cast
  return/break local jump.

* eval.c (rb_yield_0): stop TAG_RETURN/TAG_BREAK escaping.

* variable.c (rb_autoload_load): call const_missing if autoloading
  constant is not defined to allow hook.

* eval.c (rb_eval): use rb_const_get_from() instead of
  rb_const_get_at().

* eval.c (is_defined): forgot to check NODE_COLON3.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-30 00:04:02 +00:00
matz 11f521b98e * variable.c (rb_const_get_0): should check constants defined in
included modules, if klass is Object. [ruby-talk:79302]

* numeric.c (check_uint): check should be done using UINT_MAX, not
  INT_MAX. this fix is submitted by <lyle@knology.net> in
  [ruby-core:01486]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-28 08:35:43 +00:00
nobu d7bdf5df56 * variable.c (classname): find regular class name if not set.
[ruby-dev:20496]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-02 05:02:43 +00:00
matz 34ca2ab058 * variable.c (rb_mod_const_missing): "const_missing" should not
appear in the caller(); add call frame adjustment.

* eval.c (rb_method_missing): simplify call frame adjustment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-26 02:26:08 +00:00
matz 85911c410a * ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]

* Minor cleanups.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25 05:36:55 +00:00
matz 5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00
matz e02b469de1 * eval.c (thgroup_add): no warning for terminated threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 05:18:47 +00:00
matz 0d1df1cd7d * variable.c (rb_mod_const_missing): new method. [ruby-core:00441]
* variable.c (rb_const_get_at): allow "const_missing" hook.

* variable.c (rb_const_get_0): ditto.

* eval.c (method_missing): rename from rb_undefined to clarify.

* eval.c (ruby_finalize_0): update exit status if any of END proc
  raises SystemExit. [ruby-core:01256]

* eval.c (rb_exec_end_proc): reduce rb_protect().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-22 08:42:47 +00:00
matz 662e3cf1f9 * eval.c (rb_load): put rb_load_file() in a thread critical
section. [ruby-dev:20490]

* eval.c (compile): put rb_compile_string() in a thread critical
  section.

* variable.c (rb_const_get_0): should not warn if constant is not
  defined. (ruby-bugs-ja PR#509)

* bignum.c (rb_big2dbl): give a warning on overflow.
  (ruby-bugs-ja PR#510)

* util.c (ruby_strtod): change MDMAXEXPT from 511 to 308.

* pack.c (utf8_to_uv): long is sufficient.  LONG_LONG is not
  required.

* bignum.c (rb_big2str): support 32 bit (without `long long' type)
  machines. (ruby-bugs-ja PR#512)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-09 22:28:42 +00:00
matz 9d22a06ea0 * array.c (rb_values_at): extract common procedure from
rb_ary_values_at.  follow DRY principle.

* re.c (match_values_at): values_at should understand ranges.

* struct.c (rb_struct_values_at): ditto.

* struct.c (inspect_struct): inspect format changed; add "struct "
  at the top.

* sprintf.c (rb_f_sprintf): "%p" specifier for inspect output.
  (RCR#68)

* eval.c (rb_mod_undef_method): allow "undef_method" to accept
  multiple arguments. (RCR#146)

* lib/timeout.rb: put timeout in Timeout module. (RCR#121)
  [ruby-talk:61028]

* re.c (match_groups): new method added. (RCR#139)

* variable.c (rb_mod_const_of): should exclude constant defined
  in Object, unless retrieving constants of Object.

* string.c (rb_str_new4): do not allocate new string if original
  is frozen or already have copy-on-write entry. [ruby-talk:74940]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-03 11:02:53 +00:00
nobu 442c836bfe * class.c (rb_define_class, rb_define_module): also set constant under
Object.  [ruby-dev:20445]

* object.c (boot_defclass): ditto.

* variable.c (rb_const_get_at, rb_const_get_0, rb_mod_const_at,
  rb_const_defined, mod_av_set, rb_const_assign): toplevel constants
  are now under Object, rb_class_tbl remains for GC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-01 01:36:25 +00:00
matz 0c4fe2b522 * variable.c (autoload_delete): should delete Qundef from iv_tbl.
(ruby-bugs-ja PR#504)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-25 05:28:24 +00:00
matz f289fddace * parse.y (new_yield): distinguish "yield 1,2" and "yield [1,2]".
[ruby-dev:20360]

* eval.c (rb_eval): support new_yield() change.

* variable.c (rb_const_get_0): warn for Foo::BAR when BAR is a
  toplevel constant (i.e. a constant defined under Object).
  [ruby-list:36935]

* parse.y (no_blockarg): separate no block argument check and
  ret_args argument processing.

* range.c (rb_range_beg_len): out_of_range check after adjusting
  end point. [ruby-dev:20370]

* parse.y (call_args): the first argument to arg_cancat() should
  be NODE_LIST. [ruby-core:01151]

* eval.c (rb_eval): should dispatch based on ID type.

* eval.c (rb_yield_0): should restore scope_vmode during yield.
  [ruby-dev:20361]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-20 07:11:44 +00:00
matz 590a37880c * eval.c (proc_alloc): re-unification of Block and Proc. Block
class is no longer available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-16 07:14:50 +00:00
matz bad7546f15 * gc.c (define_final): eliminate rb_f_lambda() call.
* class.c (rb_scan_args): ditto.

* signal.c (sig_trap): ditto.

* hash.c (rb_hash_initialize): ditto.

* variable.c (rb_f_trace_var): ditto.

* ext/dl/dl.c (rb_dl_callback): ditto.

* ext/win32ole/win32ole.c (ev_on_event): ditto.

* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.
  Each END proc should preserve its own $SAFE level. [ruby-core:01119]

* marshal.c (marshal_load): remove unused variable "hash".
  [ruby-core:01120]

* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]

* array.c (rb_ary_first): optional argument to retrieve first n
  elements.

* array.c (rb_ary_last): optional argument to retrieve last n
  elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:44:22 +00:00
nobu 7b6452389d * variable.c (rb_autoload_load): autoloaded constants under a module
belong to the module.  [ruby-core:01094], [ruby-dev:20309]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-01 01:38:32 +00:00
nobu f130d47f6a * variable.c (rb_autoload_load): should delete autoloaded
symbol itself before load.  [ruby-core:01097]

* variable.c (rb_mod_remove_const): must not return Qundef.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-29 21:21:23 +00:00
nobu 5ddce4f7bc * eval.c (ev_const_defined, ev_const_get), variable.c
(rb_const_get_at, rb_const_get, rb_mod_remove_const): use Qundef
  as autoload marker.  [ruby-dev:18103], [ruby-dev:18184]

* eval.c (rb_mod_autoload, rb_mod_autoload_p): new method;
  Module#autoload, Module#autoload?.

* variable.c (rb_autoload, rb_autoload_load, rb_autoload_p):
  manage autoload constants per classes/modules.

* variable.c (rb_const_defined_at, rb_const_defined): return false
  for autoloading constants.

* class.c (rb_define_class, rb_define_module), eval.c (rb_eval),
  variable.c (rb_mod_const_at, rb_const_assign): removed autoload
  stuff.

* intern.h: prototypes; rb_autoload, rb_autoload_load,
  rb_autoload_p.

* lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):
  do not treat unmatched argument as an option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-29 00:11:11 +00:00
matz 2046e06513 * io.c (set_stdio): $stdin, $stdout, $stderr now became read-only.
* variable.c (readonly_setter): message changed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-15 04:20:31 +00:00
matz e74149056b * variable.c (rb_mod_name): always return empty string for
anonymous class/module.  (ruby-bugs-ja PR#424)

* config.sub: stop forcing addition of -gnu to -linux.

* variable.c (classname): refactoring.

* variable.c (rb_class_path): __tmp__classpath__ handling moved
  from classname().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-10 08:37:12 +00:00
matz dc08e8a60f * variable.c (rb_mod_name): search module path if classname is not
set yet. (ruby-bugs-ja PR#424)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09 18:33:52 +00:00
nobu 2cefaf671a * variable.c (rb_class_path): hold temporary class path in a
instance variable to get rid of GC.  [ruby-dev:19932]

* variable.c (classname): remove temporary class path when exact
  name found.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-28 10:33:43 +00:00
matz ddd9d609dc * eval.c (rb_call0): should not report uninitialized warning by
attribute reader method.

* variable.c (rb_attr_get): new function to get instance variable
  without uninitialized warning.

* io.c (argf_to_io): should prefetch argv.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-18 14:30:17 +00:00
nobu 466d685a76 * variable.c (rb_obj_classname): wrong tail recursion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31 04:16:51 +00:00
matz 74d5623029 * variable.c (rb_obj_classname): new function.
* string.c (rb_str_dup): should preserve original's class (but not
  hidden singleton class).

* string.c (rb_str_substr): ditto.

* parse.y: backout EXPR_CMDARG removal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31 04:00:17 +00:00
michal 9df466b287 Updated Copyrights of Matz to 2003.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:34:03 +00:00
knu 91b9d37a85 * st.h, st.c: Introduce new conventional typedef's, st_data_t,
st_compare_func_t, st_hash_func_t and st_each_func_t.

* st.h, st.c: Do explicit function declarations and do not rely on
  implicit declarations.  On such platforms as IA64, int argument
  values are NOT automatically promoted to long (64bit) values, so
  explicit declarations are mandatory for those functions that
  take long values or pointers.  This fixes miniruby's coredump on
  FreeBSD/IA64.

* class.c, eval.c, gc.c, hash.c, marshal.c, parse.y, variable.c:
  Add proper casts to avoid warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-06 15:55:43 +00:00
matz baa00aa250 * numeric.c (num_step): use DBL_EPSILON.
* array.c (rb_check_array_type): new function: return an array
  (convert if possible), or nil.

* string.c (rb_check_string_type): new function: return a string
  (convert if possible), or nil.

* numeric.c (rb_dbl_cmp): returns nil if values are not
  comparable.

* numeric.c (fix_cmp,flo_cmp): use rb_num_coerce_cmp()

* bignum.c (rb_big_cmp): ditto.

* numeric.c (rb_num_coerce_cmp): new coercing function for "<=>",
  which does not raise TypeError.

* numeric.c (do_coerce): can be supress exception now.

* object.c (rb_mod_cmp): should return nil for non class/module
  objects.

* re.c (rb_reg_eqq): return false if the argument is not a
  string.  now returns boolean value.

* class.c (rb_include_module): argument should be T_MODULE, not
  T_class, nor T_ICLASS.

* eval.c (is_defined): "defined?" should return "assignment" for
  attribute assignment (e.g. a.foo=b) and indexed assignment
  (e.g. a[2] = 44).

* parse.y (aryset): use NODE_ATTRASGN.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-19 09:20:20 +00:00
matz 9562813d33 README.EXT: grammer updates by Simon Cozens.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-23 08:20:35 +00:00
nobu 2ba2dba5be * variable.c (rb_global_entry): not add global entry until
initialized to avoid accessing it while GC.  [ruby-dev:18514]

* variable.c (rb_alias_variable): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-16 04:43:28 +00:00
matz 7c4d1fe5e0 * regex.c (re_match): p1 may exceed pend limit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-26 00:48:33 +00:00
matz 73a47246f2 * eval.c (rb_mod_nesting): load wrapping module should appear in
Module#nesting list. (ruby-bugs-ja:PR#328)

* eval.c (rb_thread_remove): free stack buffer on remove.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17 09:36:05 +00:00
matz 49cd091cf2 * variable.c (rb_path2class): should not use rb_eval_string().
* marshal.c (w_extended): should allow marshaling of object which
  is extended by named module.

* class.c (rb_make_metaclass): super may be T_ICLASS, need to skip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05 09:42:56 +00:00
matz 6f484e4930 * variable.c (rb_copy_generic_ivar): remove old generic instance
variable table if it existes.

	* class.c (rb_make_metaclass): metaclass of a metaclass is a
	  metaclass itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 05:20:14 +00:00
nobu 6e4ed1ffd3 * variable.c (rb_const_assign): st_delete() takes pointer to key.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-30 10:46:37 +00:00
michal 5c70716bdc variable.c: Get rid of fix len buffer in rb_class_path (ruby-core:381)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28 14:59:01 +00:00
matz eb6118992b * eval.c (rb_clear_cache_by_class): new function.
* eval.c (set_method_visibility): should have clear cache forq
  updated visibility.

* numeric.c (flo_to_s): default format precision to be "%.16g".

* util.c (ruby_strtod): use own strtod(3) implementation to avoid
  locale hell.  Due to this change "0xff".to_f no longer returns 255.0

* eval.c (avalue_to_yvalue): new function to distinguish yvalue
  (no-arg == Qundef) from svalue (no-arg == Qnil).

* eval.c (rb_yield_0): use avalue_to_yvalue().

* eval.c (assign): warn if val == Qundef where it means rhs is
  void (e.g. yield without value or call without argument).

* parse.y (value_expr): need not to warn for WHILE and UNTIL,
  since they can have return value (via valued break).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-14 06:22:31 +00:00
matz e3a8c62630 * io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.
* io.c (rb_io_mode_modenum): ditto.

* gc.c (rb_memerror): rename from mem_error, and exported.

* gc.c (Init_GC): pre-allocate NoMemoryError instance.

* object.c (convert_type): error message changed from "failed to
  convert" to "cannot convert", since it does not try to convert
  if an object does not respond to the converting method.

* eval.c (block_pass): convert Method to Proc using
  rb_check_convert_type().

* object.c (rb_check_convert_type): always convert T_DATA

* eval.c (rb_thread_cleanup): should not terminate main_thread by
  Fatal error.

* regex.c (is_in_list): need to not exclude NUL and NEWLINE.

* re.c (rb_reg_expr_str): wrong backslash escapement.

* re.c (rb_reg_expr_str): do not escape embedded space
  characters.

* marshal.c (w_object): T_DATA process patch from Joel VanderWerf
  <vjoel@PATH.Berkeley.EDU>.  This is temporary hack; it remains
  undocumented, and it will be removed when marshaling is
  re-designed.

* marshal.c (r_object): ditto.

* numeric.c (num_step): Integer#step is moved to Numeric#step;
  Fixnum#step is merged into this method.

* numeric.c (int_dotimes): Fixnum#times is merged.

* numeric.c (int_upto): Fixnum#upto is merged.

* numeric.c (int_downto): Fixnum#downto is merged.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24 04:54:16 +00:00
matz 5527b3b961 * eval.c (assign): ruby_verbose should be surrounded by RTEST().
* object.c (rb_str2cstr): ditto.

* parse.y (void_expr): ditto.

* parse.y (void_stmts): ditto.

* variable.c (rb_ivar_get): ditto.

* variable.c (rb_cvar_set): ditto.

* variable.c (rb_cvar_get): ditto.

* dir.c (glob_helper): should have proceed link when link->path
  was non existing symbolic link.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-11 10:03:01 +00:00
matz 19c42c0740 * variable.c (rb_obj_remove_instance_variable): raise NameError if
specified instance variable is not defined.

* variable.c (generic_ivar_remove): modified to check ivar
  existence.

* file.c (rb_file_s_extname): new method based on the proposal
  (and patch) from Mike Hall. [new]

* eval.c (error_handle): default to 1 unless status is set.

* eval.c (ruby_options): guard error_handle() with PROT_NONE.

* eval.c (ruby_stop): ditto.

* math.c (math_acosh): added. [new]

* math.c (math_asinh): ditto.

* math.c (math_atanh): ditto.

* struct.c (rb_struct_each_pair): method added. [new]

* class.c (rb_singleton_class): wrong condition; was creating
  unnecessary singleton class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-10 08:45:26 +00:00
nobu 3adfc84e73 * variable.c (rb_const_list): a temporary table must be freed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-20 11:15:19 +00:00