summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2003-01-14* parse.y (list_append): avoid O(n) search using node->nd_next->nd_end.matz
* parse.y (list_append): ditto. * eval.c (rb_eval): NODE_ARRY nd_end adoption. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-09* parse.y (stmt): NODE_NOT elimitation for if/unless/while/until node.matz
* parse.y (primary): ditto. * eval.c (rb_eval): reduce recursive rb_eval() call by using sort of continuation passing style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-07* hash.c (env_clear): new Hash compatible method.matz
* hash.c (env_shift): ditto. * hash.c (env_invert): ditto. * hash.c (env_replace): ditto. * hash.c (env_update): ditto. * array.c (rb_ary_join): dispatch based on "to_str". * array.c (rb_ary_times): ditto. * array.c (rb_ary_equal): ditto. * process.c (rb_f_exec): dispatch based on "to_ary". * eval.c (umethod_bind): exact class match is not required. relax the restriction to subclasses. * eval.c (rb_eval): call "inherited" before executing class body. * class.c (rb_define_class): call "inherited" after defining the constant. * class.c (rb_define_class_under): ditto. * eval.c (massign): expand first element if RHS is an array and its size is 1, and LHS has concrete assignment target (i.e. LHS has target(s) other than *var). * eval.c (massign): avoid unnecessary avalue/svalue conversion. * eval.c (rb_yield_0): ditto * array.c (rb_ary_update): do not allocate unused array if rpl is nil (i.e. merely removing elements). * io.c (io_read): should resize supplied string if it's shorter than expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-06* st.h, st.c: Introduce new conventional typedef's, st_data_t,knu
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-01* eval.c (massign): removed awkward conversion between yvalue,matz
mvalue, etc. * eval.c (rb_yield_0): new parameter added to tell whether val is an array value or not. * parse.y (yield_args): restructuring: new nodes: NODE_RESTARY2, NODE_SVALUE; removed node: NODE_RESTARGS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-30* parse.y (parse_string): readjusted.nobu
* parse.y (heredoc_identifier): readjusted. * parse.y (here_document): make EOL codes of single-quoted here-documents consistent. * parse.y (yylex): reduced unnecessary conditionals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-30* parse.y (yylex): do not accept " __END__\n". ([ruby-dev:19245])eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-30* parse.y (yylex): use strncmp instead of strcmp.eban
accept "__END__\r\n". ([ruby-dev:19241]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-24021224matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20* parse.y (do_block): split "do" block and tLBRACE_ARG block.matz
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule * parse.y (command): can take optional cmd_brace_block; use %prec to resolve shift/reduce conflict. (ruby-bugs-ja PR#372) * eval.c (ruby_finalize): trace_func should be cleared here (after executing exit procs and finalizers). * eval.c (rb_define_alloc_func): new allocation framework, based on Nobu's work [ruby-dev:19116]. "allocate" method is no longer used for object allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-19* numeric.c (num_step): use DBL_EPSILON.matz
* 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-17* node.h (NODE_ATTRASGN): new node, assignment to attribute.nobu
[ruby-core:00637]. * eval.c (is_defined, rb_eval): ditto. * parse.y (attrset, node_assign): ditto. * string.c (rb_str_substr): tail sharing. [ruby-core:00650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-16* parse.y (nextc): get rid of overrun. (pointed out by akrnobu
[ruby-list:36773]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-15* parse.y (dispose_string): dispose String object.nobu
* parse.y (heredoc_restore, here_document): fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-13* parse.y (expr): rescue clause was ignored.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-17* parse.y (dsym): garbage returned. (ruby-bugs-ja:PR#358)nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-14* configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]nobu
* 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* math.c (math_acos): check errno after operation. ditto formatz
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-07* parse.y: back out an unintended change in the syntax.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-07* class.c (rb_define_method): do not set NOEX_CFUNC if klass ismatz
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-10-23* eval.c (rb_eval): added NODE_DSYM, symbol literal withnobu
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-18* parse.y (value_expr0): allow return/break/next/redo/retry in rhsnobu
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-17* object.c (rb_str_to_dbl): RString ptr might be NULL.matz
* 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-09-27* eval.c (rb_eval): Class#inherited should be called after thematz
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-25* io.c (appendline): forget to terminate with nul.matz
* 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-23* eval.c (rb_call0): must not clear ruby_current_node, ornobu
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-22* eval.c (call_trace_func): should not call trace function whilenobu
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-20literal_append: remove.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-20* parse.y (block_append): eliminate unused literal nodes.nobu
* 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-13* eval.c (rb_eval): avoid uninitialized global/class variablenobu
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-10* parse.y (nextc): restore line number after here documents.nobu
(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-06* parse.y (rb_gc_mark_parser): ruby_eval_tree is marked in eval.c.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06* parse.y (rb_gc_mark_parser): should mark lex_input and ruby_debug_lines.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06* parse.y (rb_gc_mark_parser): should mark parse.y global variables.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06* parse.y: should not use non-NODE VALUEs in the semantic stack.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05* gc.c (gc_sweep): should mark parser.aamine
* 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-04* class.c (rb_make_metaclass): obj.meta.super.meta should be equalmatz
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-02* gc.c (gc_sweep): does reclaim nodes in also compile time, if we can.aamine
* 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-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-15* eval.c (ruby_current_node) : added to set sourceline on demand.nobu
* 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-01* parse.y (tokadd_string): ignore backslashed spaces in %w.matz
* 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-07-26* random.c: replace with Mersenne Twister RNG.matz
* 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* parse.y (yylex): modify to accept a code like "m (a){...}".aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-17* parse.y (yylex): fix typo.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-15* parse.y (heredoc_identifier): modify typo.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-13* parse.y (literal_concat_string): wrong optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-04* parse.y: remove useless function str_extend_p().aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-02object.c: rb_Integer reformat, nil#to_f added to rb_define_method.michal
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-06-28* re.c (rb_reg_expr_str): need to process backslashes properly.matz
* 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-27missing ;nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e