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

231 Коммитов

Автор SHA1 Сообщение Дата
nobu f87abaadcc * parse.y (dsym): garbage returned. (ruby-bugs-ja:PR#358)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-17 14:01:57 +00:00
nobu 604689628d * configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
* configure.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): linker
  argument to link static/shared library respectively.

* Makefile.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): added.

* bcc32/Makefile.sub, win32/Makefile.sub: ditto.

* instruby.rb (LIBRUBY_A): install to libdir.

* lib/mkmf.rb (link_command): link static library of ruby, or
  try_run fails unless LIBRUBY_SO is installed.  [ruby-dev:18646]

* eval.c (call_trace_func): toplevel caller was missing.
  [ruby-dev:18754]

* eval.c (proc_to_s): adjust created line number.

* parse.y (primary, do_block, brace_block): adjust line number of
  block to beginning line, instead of the first statement inside
  the block.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-14 13:51:19 +00:00
matz a1c02ee495 * math.c (math_acos): check errno after operation. ditto for
asin, acosh, atanh, log, log10 and sqrt.

* eval.c (rb_add_method): initialize should always be private.

* parse.y (expr): add rescue modifier rule.

* parse.y (command_call): return, break and next with argument is
  now part of this rule.

* parse.y (yylex): "a" in "a /5" should be considered as a local
  variable. [experimental]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-14 06:18:59 +00:00
matz a61871bea2 * parse.y: back out an unintended change in the syntax.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-07 23:01:45 +00:00
matz 54fdacb125 * class.c (rb_define_method): do not set NOEX_CFUNC if klass is
really a module, whose methods must be safe for reciever's type.

* eval.c (rb_eval): nosuper should not be inherited unless the
  overwritten method is an undef placeholder.

* parse.y (primary): allow 'when'-less case statement; persuaded
  by Sean Chittenden.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-07 19:18:16 +00:00
nobu d4f2f6a7f7 * eval.c (rb_eval): added NODE_DSYM, symbol literal with
interpolation.

* node.h: ditto.

* intern.h: prototypes; rb_is_junk_id, rb_str_dump, rb_str_intern

* object.c (sym_inspect): escape and quote for non-alphanumeric
  symbols.

* parse.y (dsym, tokadd_string, yylex): extended symbol literals.

* parse.y (rb_is_junk_id): added.

* string.c (rb_str_dump, rb_str_intern) : make extern.

* lib/mkmf.rb (create_makefile): deffile should be removed by
  distclean, not clean.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-23 10:17:30 +00:00
nobu 8232622071 * parse.y (value_expr0): allow return/break/next/redo/retry in rhs
of logical operator.  [ruby-dev:18534]

* parse.y (remove_begin): eliminate useless NODE_BEGIN.
  [ruby-dev:18535]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-18 14:13:41 +00:00
matz 66d1582c07 * object.c (rb_str_to_dbl): RString ptr might be NULL.
* object.c (rb_cstr_to_dbl): p pointer might be NULL.

* bignum.c (rb_str_to_inum): RString ptr might be NULL.

* bignum.c (rb_cstr_to_inum): str pointer might be NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-17 07:27:00 +00:00
matz af181db784 * eval.c (rb_eval): Class#inherited should be called after the
execution of the class body.

* parse.y (primary): remove "return outside of method" check at
  compile time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-27 04:26:21 +00:00
matz 4b9a7eac05 * io.c (appendline): forget to terminate with nul.
* eval.c (ruby_run): should set toplevel visibility again here.

* eval.c (rb_eval): should not rely on ruby_class == rb_cObject
  check.   Besides allow implicit publicity for attribute set
  methods.

* parse.y (primary): need not to check class_nest, just set
  whether method is an attrset or not.

* string.c (rb_str_each_line): p might be at the top of the
  string.

* class.c (rb_make_metaclass): class of metaclass should be
  metaclass of superclass, unless class itself is a metaclass;
  class of metaclass of metaclass should point back to self.
  eh, confusing, isn't it.

* class.c (rb_singleton_class): check if its class is singleton
  AND attached to self.

* eval.c (rb_eval): should define class/module under ruby_cbase.

* eval.c (rb_eval): should set class/module path based on
  ruby_cbase, not ruby_class.

* eval.c (module_setup): use ruby_cbase instead of ruby_class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25 07:03:05 +00:00
nobu 53178fc7db * eval.c (rb_call0): must not clear ruby_current_node, or
backtrace cannot be genetated.

* intern.h (ruby_yyparse): rather than yyparse().

* parse.y (yylex): nextc() returns -1 at end of input, not 0.

* parse.y (newline_node): reduce deplicated newline node.

* parse.y (literal_concat): get rid of warning.

* parse.y (new_evstr): fixed junk code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-23 15:48:42 +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
nobu f043430968 literal_append: remove.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-20 15:47:06 +00:00
nobu 749dea9e7c * parse.y (block_append): eliminate unused literal nodes.
* parse.y (literal_concat): refined literal concatination.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-20 14:03:45 +00:00
nobu 026e185838 * eval.c (rb_eval): avoid uninitialized global/class variable
warnings at `||='.  [ruby-dev:18278]

* parse.y (stmt, arg): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-13 09:36:28 +00:00
nobu 64bdb0c395 * parse.y (nextc): restore line number after here documents.
(ruby-bugs-ja:PR#331)

* parse.y (heredoc_restore): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-10 14:38:20 +00:00
aamine 7622095d17 * parse.y (rb_gc_mark_parser): ruby_eval_tree is marked in eval.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 23:41:43 +00:00
aamine 95d65e34e1 * parse.y (rb_gc_mark_parser): should mark lex_input and ruby_debug_lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 03:09:07 +00:00
aamine e389d3d153 * parse.y (rb_gc_mark_parser): should mark parse.y global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 02:44:51 +00:00
aamine 4ebc9ec226 * parse.y: should not use non-NODE VALUEs in the semantic stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 01:24:41 +00:00
aamine 7ac3b71611 * gc.c (gc_sweep): should mark parser.
* parse.y (rb_gc_mark_parser): new function.
* intern.h (rb_gc_mark_parser): added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05 20:00:52 +00:00
matz 64901cd69b * class.c (rb_make_metaclass): obj.meta.super.meta should be equal
to obj.meta.meta.super (ruby-bugs-ja:PR#324).

* parse.y (yylex): the warning message "invalid
  character syntax" was never issued.

* marshal.c (r_bytes): do not use alloca (ruby-bugs:PR#382).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-04 06:37:39 +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
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
nobu 92ca6c7773 * eval.c (ruby_current_node) : added to set sourceline on demand.
* eval.c (error_pos, error_print, rb_longjmp, assign): set source
  file/line.

* eval.c (rb_eval): store current node instead of file/line, and
  preserve it at return.

* eval.c (module_setup): ditto.

* eval.c (struct thread): store node instead of file/line.

* eval.c (rb_thread_raise): ditto.

* intern.h (ruby_current_node): added.

* intern.h (ruby_set_current_source): added.

* parse.y (stmt, arg): not fix position of assignment.

* parse.y (node_assign): ditto.

* parse.y (yycompile): clear current node.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-15 11:49:40 +00:00
matz 5e6634ce67 * parse.y (tokadd_string): ignore backslashed spaces in %w.
* enum.c (enum_find): do not use rb_eval_cmd(); should not accept
  a string for if_none.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-01 09:42:38 +00:00
matz 7194b66fb2 * random.c: replace with Mersenne Twister RNG.
* eval.c (jump_tag_but_local_jump): preserve retval in
  LocalJumpError exceptions.

* parse.y (command): no more check for "super outside of method".

* eval.c (rb_mod_define_method): should set last_class and
  last_func in the block->frame.

* eval.c (error_handle): should handle TAG_THROW as well.

* parse.y (yylex): new decimal notation '0d4567'.

* parse.y (yylex): new octal notation '0o777'.

* parse.y (string_content): every string_content node should
  return string only.  use NODE_EVSTR to coercing.

* eval.c (rb_eval): NODE_EVSTR support.

* re.c (rb_reg_quote): avoid unnecessary string allocation.

* string.c (get_pat): quote metachracters before compiling a
  string into a regex.

* string.c (rb_str_split_m): special treatment of strings of size
  1, but AWK emulation.  now uses get_pat().

* string.c (rb_str_match_m): quote metacharacters.

* string.c (rb_str_match2): ditto.

* ext/socket/socket.c (sock_addrinfo): make all 3 versions of
  getaddrinfo happy.  [ruby-core:00184]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-26 06:12:39 +00:00
aamine d5dc032e33 * parse.y (yylex): modify to accept a code like "m (a){...}".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-26 03:13:06 +00:00
aamine 55a65fd4e9 * parse.y (yylex): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-17 21:49:40 +00:00
aamine 141d0c380f * parse.y (heredoc_identifier): modify typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-15 01:33:36 +00:00
nobu 9b198b3d85 * parse.y (literal_concat_string): wrong optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-13 00:32:46 +00:00
aamine 02b589fd43 * parse.y: remove useless function str_extend_p().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-04 14:41:36 +00:00
michal 46934759bc object.c: rb_Integer reformat, nil#to_f added to rb_define_method.
parse.y: Clean unused vars.
range.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-02 09:58:13 +00:00
matz f0221db462 * re.c (rb_reg_expr_str): need to process backslashes properly.
* object.c (rb_any_to_a): declare Object#to_a to be obsolete.

* object.c (rb_Array): do not convert nil into [] automagically.

* object.c (rb_Integer): use "to_int" instead of
  "to_i". [experimental]

* object.c (nil_to_f): new method.

* object.c (rb_Integer): Symbols and nil should cause error.

* object.c (rb_Float): nil should cause error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28 14:42:46 +00:00
nobu eb5ea93c7c missing ;
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-27 17:16:39 +00:00
nobu 264d2e4da9 * parse.y (literal_concat_string): non-string last expression in
#{} was ignored when followed by literal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-26 23:29:10 +00:00
nobu 0fdfc0bbef * parse.y (words, qwords): word list literal rules.
* parse.y (parse_string): ditto.

* parse.y (yylex): %W: word list literal with interpolation. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-26 08:01:00 +00:00
nobu a97ba8c7f7 * parse.y (string1, xstring, regexp): moved lex_strnest
initialization to string_contents/xstring_contents.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-25 09:56:36 +00:00
nobu e8e3f56b81 * parse.y (string_dvar): allow back references in interpolation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-24 15:18:00 +00:00
matz 05b4ec8683 * parse.y (yylex): __END__ should not be effective within
string literals.

* parse.y (here_document): should be aware of __END__ within here
  documents.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-24 07:59:02 +00:00
nobu 33061b45b4 * eval.c (rb_eval): NODE_EVSTR is no longer used.
* eval.c (eval): not enforce to make assigned variables dynamic.

* parse.y (string): split rules to strings/xstring/regexp to allow
  arbitrary statements inside string interpolation.

* parse.y (here_document): splitted into three phases.

* parse.y (literall_append, literal_concat): added.
  append/concatinate string literals.

* sample/test.rb (valid_syntax): adjust line number for BEGIN.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-24 07:20:42 +00:00
nobu 772f420a18 * parse.y (yylex): ? followed by successive word charaters is
ternary operator not numeric literal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18 15:53:57 +00:00
nobu de9251e2c7 * parse.y (yylex): commands after break/next/rescue can take
arguments.  (ruby-bugs-ja:PR#265)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18 15:46:24 +00:00
matz 1979d9ae1f * parse.y (yylex): obsolete '?<whitespace>'; use '?\s', '?\n',
etc, instead.

* parse.y (yylex): no here document after a dot.

* parse.y (yylex): should have set lex_state after '`'.

* parse.y (yylex): should have set lex_state properly after
  tOP_ASGN.

* bignum.c (rb_big2dbl): return canonical HUGE_VAL for infinity.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18 06:29:07 +00:00
nobu 12c00312aa * parse.y (yylex): should pushback proper char after '<<'.
* parse.y (range_op, cond0, cond): get rid of doubled warnings.

* parse.y (value_expr): reduce recursion level.

* parse.y (logop): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-18 03:53:23 +00:00
nobu aa79984980 * parse.y (read_escape): deny zero-width hexadecimal character.
(ruby-bugs-ja:PR#260)

* parse.y (tokadd_escape): ditto.

* regex.c (re_compile_pattern): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-14 06:27:18 +00:00
matz b3ecbfaa01 * eval.c (svalue_to_avalue): v may be Qundef. This fix was
suggested by Guy Decoux.

* hash.c (rb_hash_s_create): use rb_hash_aset() instead of calling
  st_insert() directly, to dup&freeze string keys.

* parse.y (yylex): proper error message for "@@0".

* parse.y (yylex): paren to parse_string() must be zero for
  unparenthesized strings.

* parse.y (str_extend): broken string when unterminated "#{".

* enum.c (enum_sort_by): had a bug in 1 element enumeration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-13 03:55:44 +00:00
matz 91511afa9c * parse.y (yylex): 'do' should return kDO_BLOCK on EXPR_ENDARG.
* parse.y (singleton): "def (()).a end" dumped core.

* parse.y (range_op): node may be null.

* parse.y (match_gen): ditto.

* parse.y (arg): void value check for "..", "...", "!", and "not".

* parse.y (match_gen): void value check for "=~".

* parse.y (value_expr): check NODE_AND and NODE_OR recursively.

* parse.y (cond0): void value check added for conditionals.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-12 09:22:20 +00:00
nobu 94f86651d6 * parse.y (stmt): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11 17:39:38 +00:00
eban 6e01d2e2f5 * parse.y (%%): remove '%%' line on the end of the file(parse error).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11 07:26:03 +00:00