summaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
...
* * parse.y (parser_yylex): removed an useless conditional, and magicyugui2008-08-011-5/+4
| | | | | | | | | | | comment are ignored unless at the first of line. * test/ruby/test_m17n.rb (test_magic_comment_vim): added. * test/ruby/test_m17n.rb (test_magic_comment_at_variaous_positions): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (magic_comment_encoding): remove meaningless null check.mame2008-07-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (vtable_free): remove meaningless null check.mame2008-07-301-3/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_set_coverages, rb_reset_coverages): enable and disablemame2008-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | coverage measurement. * thread.c (rb_get_coverages): rename and move from vm.c. * vm.c (rb_vm_get_coverages): ditto. * iseq.c (prepare_iseq_build): ditto. * thread.c (clear_coverage): ditto. * parse.y (coverage): ditto. * ext/coverage/coverage.c: use above functions, add new method Coverage.start and fix rdoc . git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_enable_coverages): hide coverage array by setting 0 tomame2008-07-081-4/+2
| | | | | | | | | | | | | | | | | klass during measurement. * parse.y (coverage, yycompile0): ditto. * iseq.c (prepare_iseq_build): use rb_hash_lookup instead of rb_hash_aref. * thread.c (rb_coverage_result): restore klass of coverage array and return it. * theaad.c (update_coverage): chcek whether its klass is 0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: remove prototypes about coverage.mame2008-07-031-1/+2
| | | | | | | | | | | | | | | | | | | * iseq.c (prepare_iseq_build): add prototype. * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * thread.c (update_coverage): use rb_sourceline. * thread.c (rb_get_coverages): rename and move to vm.c. * vm.c (rb_vm_get_coverages): ditto. * ext/coverage/coverage.c: add rdoc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminatemame2008-07-031-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COVERAGE__ and introduce coverage.so instead. How to measure coverage: (1) require "coverage.so", (2) require or load Ruby source file, and (3) Coverage.result will return the same hash as COVERAGE__. [ruby-dev:35324] * thread.c (rb_enable_coverages): start coverage measurement by using rb_add_event_hook. * thread.c (rb_get_coverages): returns current results of coverage measurement. * include/ruby/intern.h: add prototype for above two functions. * vm_core.h, vm.c: add field of coverages to rb_vm_t. * insns.def (trace): remove special handling for COVERAGE__. * iseq.c (prepare_iseq_build): switch COVERAGE__ to rb_get_coverages(). * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * lib/coverage.rb: use coverage.so instead of COVERAGE__. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Add coverage measurement constant COVERAGE__. This constant is notmame2008-07-011-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will return an array whose elements represent number of executions per line of source code. * vm_core.h: add field of coverage array to iseq. * iseq.c (prepare_iseq_build): ditto. * insns.def (trace): update coverage array. * parse.y (coverage): create and initialize coverage array. * compile.h (ADD_TRACE): add trace instruction to update covearge array. * thread.c (clear_coverage): delete coverage array when forking. Otherwise, double count of coverage may occur. * lib/coverage.rb: sample coverage measurement tool. * error.c: distinguish explicitly between parse_in_eval and mild_compile_error. * load.c: ditto. * vm_eval.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (enum ruby_special_consts): ISO C forbidsshyouhei2008-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | comma at end of enumerator list * include/ruby/ruby.h (enum ruby_value_type): ditto. * eval_intern.h (enum): ditto. * vm_core.h (enum rb_thread_status): ditto. * parse.y (enum lex_state_e): ditto. * parse.y (enum string_type): ditto. * process.c (enum): ditto. * ruby.c (enum dump_flag_bits): ditto. * ruby.c (enum disable_flag_bits): ditto. * compile.c (iseq_link_element): ditto * debug.c (union): ditto. * cont.c (enum context_type): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): empty not should call '!' on nil.matz2008-06-271-1/+1
| | | | | | cf [ruby-dev:35227] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): not operand might be empty. [ruby-dev:35227]matz2008-06-251-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): make functional-style not operator to actmatz2008-06-251-0/+8
| | | | | | like function. see <http://d.hatena.ne.jp/ku-ma-me/20080624/p1>. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (call_args2, open_args): removed.nobu2008-06-211-78/+4
| | | | | | | | * parse.y (parser_yylex): unified warnings at space between method name and argument parenthese. [ruby-dev:33943] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-2/+2
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (assignable_gen): when "self = 1" was evalueted, unnecessarymame2008-05-191-1/+3
| | | | | | | error message was output, which might cause null pointer access. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (ripper_warnS): now unused.nobu2008-05-171-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (ripper_warningS): now used.usa2008-05-151-5/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): no need for forceful warning whenmatz2008-05-151-1/+1
| | | | | | | | converting to float. overflow is a nature of float values. * parse.y (parser_yylex): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg): operator assignment "a += b rescue c" should bematz2008-05-081-2/+35
| | | | | | | parsed as "a += (b rescue c)" just like normal assignment. [ruby-talk:301000] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_continuation.rb: remove duplicated test.matz2008-05-081-4/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):nobu2008-04-121-27/+24
| | | | | | | | | | | | | | | | use iseq instead of NODE. * gc.c (source_filenames): removed. * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free, ripper_initialize): rb_source_filename() is no longer used. * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos, parser_warn, e_option_supplied, warn_unless_e_option, range_op, cond0): nd_file is no longer used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (debug_lines): Always prepare a new array for eachknu2008-03-241-5/+2
| | | | | | | | | file's SCRIPT_LINES__ storage, instead of appending source lines every time a file is re-loaded; submitted by Rocky Bernstein in #18517. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (literal_concat_gen): bail out at different encoding.nobu2008-03-181-3/+13
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): disallow non digits '0o' expression.matz2008-03-041-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_strftime): format should be ascii compatible.matz2008-02-291-0/+4
| | | | | | | | | | | | * parse.y (rb_intern3): non ASCII compatible symbols. * re.c (rb_reg_regsub): add encoding check. * string.c (rb_str_chomp_bang): ditto. * test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (opt_block_param): command can start just after block paramnobu2008-02-291-0/+3
| | | | | | | definition. [ruby-list:44479] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (value_expr_gen): removed inappropriate warning.nobu2008-02-261-0/+8
| | | | | | | [ruby-core:15660] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (tokadd_escape): refactored. [ruby-core:15657]akr2008-02-261-6/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h (NODE_FL_NEWLINE): renamed from NODE_NEWLINEmatz2008-02-181-2/+2
| | | | | | to denote its a flag. [ruby-core:15529] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (ENC_CODERANGE_AND): added.naruse2008-02-171-1/+1
| | | | | | | | * string.c (rb_str_plus, srb_str_times): keep coderange. * parse.y (STR_NEW0) use rb_usascii_str_new. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_compile_gen): reg_fragment_setenc might not raise annobu2008-02-151-3/+7
| | | | | | | exception before rb_reg_compile. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_compile_gen): appends error message fromnobu2008-02-141-3/+8
| | | | | | | rb_reg_compile() to one from reg_fragment_setenc(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt, arg): reverted r15450. [ruby-core:15526]nobu2008-02-121-6/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_append_gen): optimize only for array push.nobu2008-02-121-3/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt, arg): concat opt_call_args only if non-null.nobu2008-02-121-8/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_concat_gen, arg_append_gen): optimize for array concat.nobu2008-02-121-3/+19
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_add_gen): removed since identical to arg_append_gen.nobu2008-02-121-17/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (exc_list): should use mrhs if non array.nobu2008-02-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (exc_list): splat literal array.nobu2008-02-121-0/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (args, mrhs): flattens literal array splats.nobu2008-02-121-4/+39
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_hash_cmp): lighter version of rb_str_cmp() formatz2008-02-121-1/+1
| | | | | | | | | | | hash comparison function. * hash.c (rb_any_cmp): use rb_str_hash_cmp(). * string.c (rb_str_casecmp): should return nil for incompatible comparison. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (range_include): specialize single character stringmatz2008-02-111-7/+9
| | | | | | | | | | | | | | | | | | | | | | case (e.g. (?a ..?z).include(?x)) for performance. [ruby-core:15481] * string.c (rb_str_upto): specialize single character case. * string.c (rb_str_hash): omit coderange scan for performance. * object.c (rb_check_to_integer): check Fixnum first. * object.c (rb_to_integer): ditto. * string.c (rb_str_equal): inline memcmp to avoid unnecessary rb_str_comparable(). * parse.y (rb_intern2): use US-ASCII encoding. * parse.y (rb_intern_str): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * trunk/parse.y (rb_enc_symname2_p): support "!", "!=" and "!~".nobu2008-02-041-1/+9
| | | | | | | [ruby-dev:33592] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (dsym): allow empty symbols. [ruby-core:15248]matz2008-01-301-6/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_fragment_setenc_gen): US-ASCII script special code.usa2008-01-281-8/+9
| | | | | | | | | | | | * parse.y (reg_fragment_check_len, reg_compile_gen): no need such trick. [ruby-dev:33399] * test/ruby/test_m17n.rb (test_regexp_usacii_literal): add tests. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_id2str, ripper_initialize, Init_ripper): use rb_usascii_str_new2.naruse2008-01-281-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c, parse.y, re.c: use rb_ascii8bit_encoding.naruse2008-01-281-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_str_new): encoding of UTF-8 literal string inusa2008-01-281-1/+1
| | | | | | | | US-ASCII script is UTF-8. [ruby-dev:33406] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_set_encode): check if encoding is ASCII compatible.nobu2008-01-271-1/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/oniguruma.h: precise mbclen API redesigned to avoidakr2008-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inline functions. (onigenc_mbclen_charfound): removed. (onigenc_mbclen_needmore): removed. (onigenc_mbclen_recover): removed. (ONIGENC_MBCLEN_CHARFOUND): removed. (ONIGENC_MBCLEN_CHARFOUND_P): defined. (ONIGENC_MBCLEN_CHARFOUND_LEN): defined. (ONIGENC_MBCLEN_INVALID): removed. (ONIGENC_MBCLEN_INVALID_P): defined. (ONIGENC_MBCLEN_NEEDMORE): removed. (ONIGENC_MBCLEN_NEEDMORE_P): defined. (ONIGENC_MBCLEN_NEEDMORE_LEN): defined. (ONIGENC_MBC_ENC_LEN): use onigenc_mbclen_approximate. * regenc.c (onigenc_mbclen_approximate): defined. * include/ruby/encoding.h (MBCLEN_CHARFOUND): removed. (MBCLEN_INVALID): removed. (MBCLEN_NEEDMORE): removed. (MBCLEN_CHARFOUND_P): defined. (MBCLEN_INVALID_P): defined. (MBCLEN_NEEDMORE_P): defined. (MBCLEN_CHARFOUND_LEN): defined. (MBCLEN_NEEDMORE_LEN): defined. * encoding.c: use new API. * re.c: ditto. * string.c: ditto. * parse.y: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e