summaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* merges r25967, r25968 and r25969 from trunk into ruby_1_9_1. fixes a ↵yugui2009-12-051-19/+26
| | | | | | | | | | | | | | | | | backport task #2099. -- * parse.y (dyna_push_gen, dyna_pop_gen): adjust local vtable level for the case of syntax errors in method name or argument inside do block. [ruby-core:26961] -- * parse.y (dyna_push_gen): use rb_node_newnode() for ripper. [ruby-core:26961] -- * parse.y (dyna_push_gen, dyna_pop_gen): no needs to save both of args and vars. [ruby-core:26961] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25405 from trunk into ruby_1_9_1. fixes the backport task #2233.yugui2009-12-051-4/+4
| | | | | | | | -- * parse.y (method_call): dispatch symbols. a patch from Andy Keep in [ruby-core:26169]. [ruby-core:26165] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25404 from trunk into ruby_1_9_1. fixes the backport task #2232.yugui2009-12-051-1/+2
| | | | | | | | -- * parse.y (mlhs_basic): fixed handling splat in middle of mlhs. a patch from Andy Keep in [ruby-core:26163] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25351 from trunk into ruby_1_9_1. fixes the backport task #2214.yugui2009-12-051-0/+10
| | | | | | | | -- * parse.y (rb_intern3): check symbol table overflow. [ruby-core:26092] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25402 from trunk into ruby_1_9_1. fixes the backport task #1921.yugui2009-12-051-20/+49
| | | | | | | | -- * parse.y (parser_here_document): dispatch delayed heredoc contents. based on a patch from Andy Keep in [ruby-core:24855]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25209 from trunk into ruby_1_9_1.yugui2009-12-051-3/+3
| | | | | | | | -- * parse.y (bv_decls, bvar): fix for block variables. [ruby-dev:39423] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r25187 from trunk into ruby_1_9_1.yugui2009-12-051-149/+203
| | | | | | | | | | | | | | | | -- * parse.y (ripper_yylval_id, ripper_get_{id,value}): wrap ID by NODE to track local variable assignment. * parse.y (lvar_defined_gen, assignable_gen): enable local variable check. [ruby-core:24923] * parse.y (validate): use value only. * test/ripper/test_parser_events.rb (test_local_variables): tests based on a patch from Magnus Holm in [ruby-core:25885]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24761 and r24999 from trunk into ruby_1_9_1.yugui2009-11-271-2/+2
| | | | | | | | | | | -- * compile.c (iseq_compile_each): op_asgn to aref should return rhs. [ruby-core:25387] -- * compile.c (iseq_compile_each), parse.y (stmt, arg): arg_concat() on op_asgn was inversed. [ruby-core:25629] [Bug #2050] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24714 from trunk into ruby_1_9_1.yugui2009-10-281-1/+1
| | | | | | | -- * parse.y (rb_enc_symname2_p): not depend on nul terminator. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24579 and r24581 from trunk into ruby_1_9_1.yugui2009-10-281-0/+4
| | | | | | | | | | | | | | -- * compile.c (NODE_RETURN): fire return event at explicit return. [ruby-dev:38701] -- * test/ruby/test_settracefunc.rb (test_return, test_return2): add two tests for [ruby-dev:38701] and [ruby-core:24463]. -- * parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during node reducing. [ruby-core:24463] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24569 from trunk into ruby_1_9_1.yugui2009-10-281-15/+36
| | | | | | | | -- * parse.y (lex_get_str, lex_io_gets, rb_parser_compile_string): must be ascii compatible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24557 from trunk into ruby_1_9_1.yugui2009-10-281-1/+0
| | | | | | | | -- * parse.y (yylex): should dispatch scan-event even when follows just after delayed-token. [ruby-dev:37855] [Bug #1071] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24332 and r24333 from trunk into ruby_1_9_1.yugui2009-08-081-0/+4
| | | | | | | | | | | | | -- * parse.y (literal_concat_gen): NODE_DSTR was incorrectly handled as NODE_STR. [ruby-dev:38968] * bootstraptest/test_syntax.rb: add a test for above. -- * parse.y (literal_concat_gen): reduced unnecessary node at string literal concatenation with empty head dstr. [ruby-dev:38968] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24243 from trunk into ruby_1_9_1.yugui2009-08-081-4/+0
| | | | | | | | | | | | | | | | | -- * vm_core.h (struct rb_iseq_t): add a new field line_no. This field represents line number from which the original code of the iseq starts. [ruby-dev:38698] * iseq.c, compile.c: ditto. * parse.y: line number hack (for Proc#source_location) is no longer needed. * test/ruby/test_settracefunc.rb: line number of set_trace_func is now compatible with 1.8's. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r23932 from trunk into ruby_1_9_1.yugui2009-07-121-1/+1
| | | | | | | -- * parse.y (parser_yylex): fixed wrong variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r23837 from trunk into ruby_1_9_1.yugui2009-06-241-2/+12
| | | | | | | | -- * parse.y (parser_set_encode): show the erred file name instead of the file that requires it. [ruby-core:24006] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r23474 from trunk into ruby_1_9_1.yugui2009-05-221-3/+4
| | | | | | | | | | -- * compile.c (rb_parse_in_eval): returns true in true eval, not in main. [ruby-dev:38382] * parse.y (program): inherits dvars in eval or main. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r23435 from trunk into ruby_1_9_1.yugui2009-05-211-2/+2
| | | | | | | | -- * parse.y (magic_comment_encoding): use rb_compile_warning() to show the currently parsing file name. [ruby-core:23469] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (top_compstmt, top_stmts, top_stmt): prohibit BEGIN {} inmame2009-01-291-23/+69
| | | | | | | | | | non-toplevel scope. [ruby-core:21657] * test/ruby/test_beginendblock.rb (test_begininclass): add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21588 from trunk into ruby_1_9_1.yugui2009-01-161-1/+1
| | | | | | * parse.y (rb_parse_in_main): fixed typo. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21571 from trunk into ruby_1_9_1.yugui2009-01-151-1/+2
| | | | | | | | | | | * ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script. * compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script) * parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21079 from trunk into ruby_1_9_1.yugui2008-12-271-0/+1
| | | | | | | | | | | | | | | | | * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first. * vm.c (vm_set_main_stack, rb_iseq_eval_main): added. * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag. * eval.c (ruby_exec_node): use rb_iseq_eval_main() instead of rb_iseq_eval(). * iseq.c (rb_iseq_new_main), vm_core.h: added. main script (specified by -e or script name) should be run under TOPLEVEL_BINDING using Kernel#eval. Above changes simulate Kernel#eval behaviour. [ruby-dev:37240] * compile.c (make_name_for_block): skip iseq except block type. this fix is needed for [ruby-dev:37240], and also fixes [ruby-dev:35392]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20952 from trunk into ruby_1_9_1.yugui2008-12-261-7/+2
| | | | | | | * string.c (rb_external_str_new_with_enc): set ASCII-8BIT if encoding is US-ASCII and string contains 8bit characters. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20905 from trunk into ruby_1_9_1.yugui2008-12-261-1/+7
| | | | | | | | | | | * parse.y (gettable_gen): the encoding of __FILE__ should be rb_filesystem_encoding(). [ruby-list:45733] * parse.y (gettable_gen): __FILE__ should be ASCII-8BIT when filesystem encoding is US-ASCII and __FILE__ contains non 7bit characters. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20782 from trunk into ruby_1_9_1.yugui2008-12-171-1/+1
| | | | | | * parse.y (stmt): returns dispatched result. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20781 from trunk into ruby_1_9_1.yugui2008-12-171-16/+5
| | | | | | * parse.y (primary): also in ripper, saves in_def before restoring. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20770 from trunk into ruby_1_9_1.yugui2008-12-171-1/+6
| | | | | | | * parse.y (block_call): block should not be given to yield. [ruby-core:20583] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20684 from trunk into ruby_1_9_1.yugui2008-12-131-5/+5
| | | | | | must be typos. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20593 from trunk into ruby_1_9_1.yugui2008-12-131-4/+4
| | | | | | | | | | | | | * compile.c (iseq_compile_each), gc.c (assign_heap_slot), (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20469 from trunk into ruby_1_9_1.yugui2008-12-041-3/+3
| | | | | | | * parse.y (expr): keyword_not can continue across newline. [ruby-core:20252] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): check EOF explicitly.mame2008-10-281-11/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (lambda): need to adjust lpar_beg for both of the parser andnobu2008-10-241-1/+1
| | | | | | | ripper. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (lambda): need to adjust lpar_beg for ripper as well. matz2008-10-241-2/+2
| | | | | | [ruby-dev:36702] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (f_larglist): should not allow semicolon separated localmatz2008-10-221-1/+1
| | | | | | | | variable declarations if formal argument list is not surrounded by parentheses, mostly because semicolon outside of parentheses appears to terminate the expression. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_concat_gen): concat target node should be NODE_ARRAY.ko12008-10-211-3/+3
| | | | | | | | | [ruby-core:19413] * bootstraptest/test_method.rb: add tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (opt_block_arg): allow trailing comma after usualmatz2008-10-181-0/+4
| | | | | | arguments. not after block argument. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (ID_H_TARGET): phony target to update id.h.nobu2008-10-171-0/+1
| | | | | | | | | | | | * tool/ifchange, win32/ifchange.bat: --timestamp option added. * tool/generic_erb.rb: --timestamp, --output and --if-change options added. * template/id.h.tmpl: moved from id.h. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): allow reserved word to be keyword argument.matz2008-10-141-10/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (token_info_pop): show source filename. [ruby-dev:36710]naruse2008-10-131-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_prepare): use utf-8 encoding directly.nobu2008-10-111-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: optimize 'for' statement when one variable given.ko12008-10-101-6/+17
| | | | | | | | | * benchmark/bm_loop_for.rb: added. * benchmark/bm_loop_times.rb: modified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (comment_at_top): needed for ripper too.nobu2008-10-101-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (magic_comment_encoding): warns when ignored.nobu2008-10-101-9/+28
| | | | | | | | | | * parse.y (parser_magic_comment): replaces '-' with '_'. * parse.y (parser_yylex): allows magic comments indented and the second line or later. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: embeds the elements of an array into itsyugui2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | struct RArray for # of elements <= 3. * array.c: ditto. * gc.c (gc_mark_children): following the change of struct RArray. * ext/tk/tcltklib.c (ip_ruby_cmp): ditto. * parse.y (coverage): ditto. * proc.c (curry): ditto. * .gdbinit: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt): returns non zero. [ruby-dev:36633]nobu2008-09-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (token_info_push, token_info_pop): do nothing for evalednobu2008-09-291-1/+4
| | | | | | | source. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary, brace_block): fix for line number.nobu2008-09-261-0/+4
| | | | | | | | * proc.c (rb_proc_location, rb_method_location): new methods {Proc,Method,UnboundMethod}#source_location. [ruby-core:18452] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+1
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: clean upko12008-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | - remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: strings which contain only US-ASCII don't force to havenaruse2008-09-191-4/+2
| | | | | | US-ASCII encoding. [ruby-dev:36400] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e