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

107 Коммитов

Автор SHA1 Сообщение Дата
nobu 032248d337 * parse.y: remove static variables. [ruby-dev:26530]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-13 13:44:21 +00:00
ocean 08133b1344 * dir.c, eval.c, parse.y, process.c, ruby.c: avoid warning "unused
variable" [ruby-dev:26387]

* dir.c (glob_helper): avoid warning "enumeration value `RECURSIVE'
  not handled in switch" [ruby-dev:26392]

(patch from Kazuhiro NISHIYAMA)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-28 13:08:32 +00:00
usa 79d206efef * ruby.c (load_file): '!' is already read. reported by gotoyuzo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-16 06:43:00 +00:00
matz d3a0ec7636 * numeric.c (fix_pow): support Fixnum ** Float case directly
without coercing.  [ruby-talk:142697] [ruby-talk:143054]

* ruby.c (require_libraries): caused SEGV when continuation jumped
  in to the required library code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-24 15:24:23 +00:00
nobu 434e8a3796 * intern.h (ruby_pragma): prototype. [ruby-core:04881]
* parse.y (parser_pragma): parse Emacsen hack.

* parse.y (parser_prepare): deal with specific syntax at the top.

* ruby.c (load_file): read the first line iff it started with shebang.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-14 02:48:07 +00:00
nobu fa1855c6d4 * ruby.c (process_sflag): replace '-' in variable names with '_'.
[ruby-dev:26107]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-01 00:13:48 +00:00
nobu 0dd5e501ad * ruby.c (set_arg0): use also environment variable space for setting
$0.  [ruby-core:04774]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-27 23:21:58 +00:00
nobu 756a1c457e * ruby.c (ruby_incpush_expand, proc_options): expand relative path
given with -I option.  [ruby-dev:26090]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-20 21:44:20 +00:00
matz 70bbad3cfd * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.

* eval.c (rb_exec_recursive): new function.

* array.c (rb_ary_join): use rb_exec_recursive().

* array.c (rb_ary_inspect, rb_ary_hash): ditto.

* file.c (rb_file_join): ditto.

* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.

* io.c (rb_io_puts): ditto.

* object.c (rb_obj_inspect): ditto

* struct.c (rb_struct_inspect): ditto.

* lib/set.rb (SortedSet::setup): a hack to shut up warning.
  [ruby-talk:132866]

* lib/time.rb (Time::strptime): add new function.  inspired by
  [ruby-talk:132815].

* lib/parsedate.rb (ParseDate::strptime): ditto.

* regparse.c: move st_*_strend() functions from st.c.  fixed some
  potential memory leaks.

* exception error messages updated.  [ruby-core:04497]

* ext/socket/socket.c (Init_socket): add bunch of Socket
  constants.  Patch from Sam Roberts <sroberts@uniserve.com>.
  [ruby-core:04409]

* array.c (rb_ary_s_create): no need for negative argc check.
  [ruby-core:04463]

* array.c (rb_ary_unshift_m): ditto.

* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
  of StandardError class, not Exception class.  [ruby-core:04429]

* parse.y (fcall_gen): lvar(arg) will be evaluated as
  lvar.call(arg) when lvar is a defined local variable. [new]

* object.c (rb_class_initialize): call inherited method before
  calling initializing block.

* eval.c (rb_thread_start_1): initialize newly pushed frame.

* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
  fixed: [ruby-core:04444]

* eval.c (is_defined): NODE_IASGN is an assignment.

* ext/readline/readline.c (Readline.readline): use rl_outstream
  and rl_instream.  [ruby-dev:25699]

* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
  [ruby-dev:25675]

* misc/ruby-mode.el: [ruby-core:04415]

* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]

* lib/rdoc/generators/ri_generator.rb: ditto.

* struct.c (make_struct): fixed: [ruby-core:04402]

* ext/curses/curses.c (window_color_set): [ruby-core:04393]

* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
  [ruby-talk:130092]

* object.c: [ruby-doc:818]

* parse.y (open_args): fix too verbose warnings for the space
  before argument parentheses.  [ruby-dev:25492]

* parse.y (parser_yylex): ditto.

* parse.y (parser_yylex): the first expression in the parentheses
  should not be a command.  [ruby-dev:25492]

* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]

* object.c (Init_Object): remove Object#type.  [ruby-core:04335]

* st.c (st_foreach): report success/failure by return value.
  [ruby-Bugs-1396]

* parse.y: forgot to initialize parser struct.  [ruby-dev:25492]

* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
  [ruby-talk:127711]

* document updates - [ruby-core:04296], [ruby-core:04301],
  [ruby-core:04302], [ruby-core:04307]

* dir.c (rb_push_glob): should work for NUL delimited patterns.

* dir.c (rb_glob2): should aware of offset in the pattern.

* string.c (rb_str_new4): should propagate taintedness.

* env.h: rename member names in struct FRAME; last_func -> callee,
  orig_func -> this_func, last_class -> this_class.

* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* object.c (Init_Object): remove rb_obj_id_obsolete()

* eval.c (rb_mod_define_method): incomplete subclass check.
  [ruby-dev:25464]

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]

* bignum.c (rb_big_rand): should return positive random number.
  [ruby-dev:25401]

* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
  random bignums.  [ruby-dev:25396]

* variable.c (rb_autoload): [ruby-dev:25373]

* eval.c (svalue_to_avalue): [ruby-dev:25366]

* string.c (rb_str_justify): [ruby-dev:25367]

* io.c (rb_f_select): [ruby-dev:25312]

* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]

* struct.c (make_struct): [ruby-dev:25249]

* dir.c (dir_open_dir): new function.  [ruby-dev:25242]

* io.c (rb_f_open): add type check for return value from to_open.

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 06:47:45 +00:00
usa 5ff5e1c91d * ruby.c (proc_options): correct -T option in RUBYOPT.
fixed: [ruby-dev:25512]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-25 08:10:33 +00:00
nobu 378f74227e * ruby.c (proc_options): ignore trailing CRs at the end of short
options as well as long options.  fixed: [ruby-core:04232]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-15 05:58:02 +00:00
matz c0a998d027 * parse.y (rb_parser_append_print): should handle prelude.
[llama@u01.gate0]

* parse.y (rb_parser_while_loop): ditto.

* array.c (rb_ary_subseq): original object might be modified after
  sharing data creation.  [ruby-dev:24327]

* array.c (rb_ary_replace): ditto.

* array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]

* struct.c (struct_members): always check struct size and size of
  members list in the class.  [ruby-dev:24320]

* string.c (rb_str_sub_bang): check if string is not modified
  during iteration.  [ruby-dev:24315]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-24 05:53:43 +00:00
matz 136b284b59 * parse.y: remove global variables ruby_eval_tree and
ruby_eval_tree_begin.

* array.c (rb_ary_collect_bang): element size might change during
  comparison.  [ruby-dev:24300]

* array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300]

* array.c (rb_ary_eql): ditto. [ruby-dev:24300]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22 00:19:15 +00:00
matz ca14017bb6 * gc.c (define_final): should not disclose NODE* to Ruby world.
[ruby-dev:23957]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-23 07:52:38 +00:00
nobu 42fa4e83cd * ruby.c (require_libraries): restore source file/line after
statically linked extensions initialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-11 10:10:18 +00:00
aamine 6dcbfbc525 * eval.c (Init_load): make $LOADED_FEATURES built-in. [ruby-dev:23299]
* ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in.
* lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-02 02:36:48 +00:00
nobu 21410f4dfe * configure.in (rb_cv_noreturn): default for platforms not support
prototypes.

* ruby.c (ruby_init_loadpath): buffer for path name should have
  MAXPATHLEN.

* lib/mkmf.rb (configuration): include topdir and hdrdir in VPATH.

* lib/mkmf.rb (create_makefile): default dependency rule.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-12 11:19:22 +00:00
usa f2b4e71013 * ruby.c (opt_W_getter): get rid of warning.
* bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub:
  fixed dependency.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-10 01:17:12 +00:00
matz 54a0407425 * eval.c (method_hash): new method. [ruby-talk:93968]
* eval.c (proc_eq): do not compare dyna_vars.

* eval.c (proc_hash): new method.

* eval.c (rb_yield_0): protect break/return from within orphan (or
  lambda) Proc object.

* parse.y (yylex): should not allow symbol for invalid global
  variable (e.g. `:$-)`). [ruby-core:02518]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-03 04:55:35 +00:00
matz 002517aba8 * parse.y (newline_node): do not use NODE_NEWLINE node anymore,
use NEWLINE flag instead.

* ext/socket/socket.c (sock_gethostbyname): returns host if
  ai_canonname is NULL. (ruby-bugs PR#1243)

* parse.y (block_append): update nd_end for "real" head node.
  [ruby-list:39058]

* marshal.c (w_class): should not dump singleton class.
  [ruby-dev:22631]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 16:47:23 +00:00
siena fc69b2a7f6 * defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.
* dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen().
* file.c (CharNext): ditto.
* ruby.c (translate_char): ditto.
* util.c (__crt0_glob_function): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 15:26:11 +00:00
eban 736668f2b0 * ruby.c: use translate_char() on Cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-18 11:49:46 +00:00
nobu 4646ba6b2a * ext/stringio/stringio.c (strio_set_string, strio_reopen): check
tainted.

* ext/stringio/stringio.c (strio_copy, strio_ungetc, strio_write,
  strio_putc): add infection.

* ext/stringio/stringio.c (strio_path): just nil.  [ruby-dev:21846]

* ruby.c (proc_options): reserve searched script path in the
  source file name table.  [ruby-list:38765]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-06 01:17:59 +00:00
matz 029e9449ce * ruby.c (proc_options): -F set compiled regular expression to $;.
[ruby-talk:77381]

* string.c (Init_String): no setter type check for $;


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-30 07:08:56 +00:00
eban 2555db608e * ruby.c: typo fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-30 02:15:13 +00:00
matz fe13785cc6 * marshal.c (w_object): if object responds to 'marshal_dump',
Marshal.dump uses it to dump object.  unlike '_dump',
  marshal_dump returns any kind of object.

* marshal.c (r_object0): restore instance by calling
  'marshal_load' method.  unlike '_load', it's an instance
  method, to handle cyclic reference.

* marshal.c (marshal_load): all objects read from file should be
  tainted. [ruby-core:01325]

* lib/timeout.rb (Timeout::timeout): execute immediately if sec is
  zero.

* ext/socket/socket.c (socks_init): typo fixed. [ruby-talk:77232]

* ext/socket/extconf.rb: the default value for --enable-socks is
  taken from ENV["SOCKS_SERVER"]. [ruby-talk:77232]

* ruby.c (proc_options): add -W option. -W0 to shut up all warning
  messages. [ruby-talk:77227]

* error.c (rb_warn): no message will be printed if the value of
  $VERBOSE is "nil", i.e. perfect silence.

* ruby.c (verbose_setter): $VERBOSE value is either true, false,
  or nil.

* io.c (Init_IO): no "read" check for $stdin.  in addition some
  function names has been changed.

* regex.c (re_match_exec): incorrect multibyte match.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 18:26:55 +00:00
matz 67dcad92b7 * string.c (rb_str_upto): generate sequence according to "succ"
order.  formerly check was done by dictionary order.
  [ruby-talk:74138]

* string.c (rb_string_value): fill constant empty string along
  with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179]

* string.c (rb_string_value_ptr): ditto.

* string.c (rb_check_string_type): ditto.

* string.c (str_gsub): move END(0) check before mbclen2().

* string.c (scan_once): reduce END(0) check.

* io.c (rb_io_initialize): accept fixnum mode.

* eval.c (error_print): replace strchr() by memchr(), einfo may
  contain "\0".

* pack.c (pack_unpack): range check for "@" move; initialize check
  for "m".

* error.c (syserr_initialize): avoid buffer overflow.

* file.c (rb_file_s_readlink): expand buffer until readlink
  succeed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 06:52:39 +00:00
usa 65ba3eba64 * defines.h (PATH_ENV): name of PATH environment. [new].
* defines.h (ENV_IGNORECASE): define for case insensitive platforms
  to access environment variables.

* dln.c (dln_find_exe): use PATH_ENV instead of "PATH".

* hash.c (env_delete, rb_f_getenv, env_fetch, rb_env_path_tainted,
  env_aset): ditto.

* ruby.c (proc_options): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-20 06:22:50 +00:00
uema2 a16fc220ca * ruby.c: don't call VirtualQuery in ruby_init_loadpath()
on mswince.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-22 11:58:08 +00:00
matz 0cd7c01c6a * eval.c (rb_yield_0): call avalue_to_mrhs() to assign block
parameter |a|. [ruby-dev:19897]

* ruby.c (ruby_set_argv): freeze argument strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25 08:26:08 +00:00
nobu 050f2d8460 * ruby.c (proc_options): script argument is in effect only when -e is not given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-13 03:02:19 +00:00
nobu 2f6595c1ed * ruby.c (ruby_init_loadpath): ensures buffer terminated
before use strncpy().

* ruby.c (proc_options): avoid SEGV at -S with no arguments.
  (ruby-bugs-ja:PR#391)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-13 00:59:00 +00:00
michal 4e13d36561 -Wall cleanups (removed unused vars, no 'code has no effect' warnings)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:38:40 +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
nobu 10c93d6c74 * ruby.c (ruby_init_loadpath): under Windows, get the module
path from an internal address instead of hard coded library
  name.

* cygwin/GNUmakefile.in, bcc32/Makefile.sub,
  win32/Makefile.sub (CPPFLAGS): removed LIBRUBY_SO macro.

* bcc32/Makefile.sub, win32/Makefile.sub (config.h): no longer
  depends on makefiles.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-05 01:40:24 +00:00
uema2 b19e36a214 * configure.in, defines.h, dir.c, dir.h, dln.c, error.c,
eval.c, file.c, hash.c, io.c, main.c, missing.c,
      process.c, ruby.c, rubysig.h, signal.c, st.c, util.c, util.h,
      bcc/Makefile.sub, win32/Makefile.sub, win32/win32.h,
      ext/Win32API/Win32API.c, ext/socket/getaddrinfo.c,
      ext/socket/getnameinfo.c, ext/socket/socket.c,
      ext/tcltklib/stubs.c
      : replace "NT" with "_WIN32", add DOSISH_DRIVE_LETTER
* wince/exe.mak : delete \r at the end of lines.
* wince/mswince-ruby17.def : delete rb_obj_become


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-15 03:18:08 +00:00
knu a2868ff651 * eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,
ext/socket/socket.c: differentiate long and int; use proper
  printf type specifiers and do casts where appropriate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-29 21:35:28 +00:00
nobu 4b6dffad02 * bcc32/mkexports.rb: to work on cygwin via telnet.
[ruby-win32:358]

* ext/tcltklib/tcltklib.c (ip_invoke): requires command name
  argument.  [ruby-dev:18438]

* eval.c (ruby_init, ruby_options): Init_stack() with local
  location.  (ruby-bugs-ja:PR#277)

* eval.c (rb_call0): disable trace call.  [ruby-dev:18074]

* eval.c (eval, rb_load): enable trace call.  [ruby-dev:18074]

* eval.c (rb_f_require): set source file name for extension
  libraries.  [ruby-dev:18445]

* ruby.c (translate_char): translate a character in a string;
  DOSISH only.  [ruby-dev:18274]

* ruby.c (ruby_init_loadpath): added argv[0] handling under
  Human68K.  [ruby-dev:18274]

* ruby.c (proc_options): translate directory separator in $0 to
  '/'.  [ruby-dev:18274]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-03 11:20:31 +00:00
nobu 742283385f * eval.c (call_trace_func): should not call trace function while
compilation.

* eval.c (rb_call0): also inside c-func.

* parse.y (yycompile): ditto.

* ruby.c (require_libraries): preserve source file/line for each
  require.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-22 12:52:18 +00:00
aamine 10c4364287 * gc.c (gc_sweep): does reclaim nodes in also compile time, if we can.
* ruby.c (load_file): omit GC if we can.
* parse.y (ruby_parser_stack_on_heap): new function.
* intern.h (ruby_parser_stack_on_heap): added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-02 12:19:30 +00:00
nobu a13ebdb836 * ruby.c (require_libraries): prevent ruby_sorcefile from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-27 11:00:24 +00:00
michal ffc13a6525 *.c: Int vs Long cleanup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21 15:47:54 +00:00
knu 510c93caac * ruby.c (set_arg0): Correct the position of #endif.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-12 13:39:22 +00:00
matz 4ab1577db3 * parse.y: yyparse #defines moved from intern.h
* ruby.c (proc_options): access prefixed "ruby_yydebug".

* applied modifies to pacify some of gcc -Wall warnings.

* parse.y (arg): no more ugly hack for "**", so that "-2**2" to be
  parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed
  as "-(2**2)".

* parse.y (yylex): '-2' to be literal fixnum. [new]

* time.c (time_succ): new method for Range support.

* time.c (time_arg): nil test against v[6] (usec).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-29 05:20:39 +00:00
nobu 1fe8b37425 * ruby.c (proc_options): option parsing problem.
(ruby-bugs-ja:PR#233)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-23 07:41:53 +00:00
matz 6e87a54aec * ruby.c (proc_options): removed "-*-" support for #! line.
* io.c (rb_io_s_sysopen): new method to get a raw file
  descriptor. [new]

* ext/socket/socket.c (tcp_sysaccept): new method to return an
  accepted socket fd (integer). [new]

* ext/socket/socket.c (unix_sysaccept,sock_sysaccept): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-23 05:35:32 +00:00
nobu 730d8f1d32 * ruby.c (proc_options): -T consumes digits only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-22 12:32:15 +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
nobu effd8230ea * gc.c (rb_source_filename): added. holds unique strings for file
names with GC space.

* gc.c (rb_gc_mark): mark source file name.

* gc.c (gc_sweep): ditto.

* gc.c (Init_GC): initialize source file name table.

* intern.h (rb_source_filename): added.

* eval.c (rb_eval_string): use rb_source_filename().

* parse.y (yycompile): ditto.

* ruby.c (proc_options): ditto.

* ruby.c (load_file): ditto.

* ruby.c (ruby_script): ditto.

* ruby.c (ruby_prog_init): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-07 11:19:37 +00:00
nobu 1995213e4b * ruby.c (load_file): avoid SEGV on '#' only input.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-10 07:55:40 +00:00