summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2012-10-18parse.y: fail if yyerrornobu
* parse.y (assignable_gen): fail if yyerror occurred. fix a bug in r36973. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-16parse.y: suppress warningsnobu
* parse.y (id_type): suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-15parse.y: new_attr_op_assignnobu
* parse.y (new_attr_op_assign): extract. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-15parse.y: new_op_assignnobu
* parse.y (new_op_assign): extract. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-15parse.y: switchnobu
* parse.y (gettable_gen, assignable_gen): rewrite sequential if-else as switch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-15parse.y: static tablenobu
* parse.y (lex_state_name): use static table. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-05* parse.y (rb_warn4S): renamed from rb_warn4(), because the case inusa
r36911 takes a string. * parse.y (rb_warn4S): use ripper_warnS() for ripper. * parse.y (ripper_warnS): now it is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-05* parse.y (rb_warn4): added as a rb_warn variant to warn with explicitnaruse
source file name and line in parse.y. * parse.y (warn_unused_var): use rb_warn4 to suppress warning on ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31id.h: independent from parse.hnobu
* template/id.h.tmpl, tool/id2token.rb: make id.h independent from parse.h, and make parse.c dependent on it instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-25parse.y: extract functionnobu
* parse.y (new_args_tail_gen): extract from dsym rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-23* include/ruby/ruby.h: introduce flonum technique forko1
64bit CPU environment (sizeof(double) == sizeof(VALUE)). flonum technique enables to avoid double object creation if the double value d is in range about between 1.72723e-77 < |d| <= 1.15792e+77 or 0.0. flonum Float value is immediate and their lowest two bits are b10. If flonum is activated, then USE_FLONUM macro is 1. I'll write detailed in this technique on https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech * benchmark/bmx_temp.rb: add an benchmark for simple Float calculation. * gc.c (id2ref, rb_obj_id): add flonum Float support. * include/ruby/intern.h: move decl of rb_float_new(double) to include/ruby/ruby.h. * insns.def, vm.c, vm_insnhelper.c: add flonum optimization and simplify source code. * vm_insnhelper.h (FLONUM_2_P): added. * marshal.c: support flonum output. * numeric.c (rb_float_new_in_heap): added. * parse.y: support flonum. * random.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-20parse.y: token namenobu
* parse.y: more descriptive token names in syntax error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-17id.h.tmpl: preserved idsnobu
* template/id.h.tmpl (preserved_ids): move from parse.y. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-16* vm_trace.c, vm_core.h: simplify tracing mechanism.ko1
(1) add rb_hook_list_t data structure which includes hooks, events (flag) and `need_clean' flag. If the last flag is true, then clean the hooks list. In other words, deleted hooks are contained by `hooks'. Cleanup process should run before traversing the list. (2) Change check mechanism See EXEC_EVENT_HOOK() in vm_core.h. (3) Add `raw' hooks APIs Normal hooks are guarded from exception by rb_protect(). However, this protection is overhead for too simple functions which never cause exceptions. `raw' hooks are executed without protection and faster. Now, we only provide registration APIs. All `raw' hooks are kicked under protection (same as normal hooks). * include/ruby/ruby.h: remove internal data definition and macros. * internal.h (ruby_suppress_tracing), vm_trace.c: rename ruby_suppress_tracing() to rb_suppress_tracing() and remove unused function parameter. * parse.y: fix to use renamed rb_suppress_tracing(). * thread.c (thread_create_core): no need to set RUBY_VM_VM. * vm.c (mark_event_hooks): move definition to vm_trace.c. * vm.c (ruby_vm_event_flags): add a global variable. This global variable represents all of Threads and VM's event masks (T1#events | T2#events | ... | VM#events). You can check the possibility kick trace func or not with ruby_vm_event_flags. ruby_vm_event_flags is maintained by vm_trace.c. * cont.c (fiber_switch, rb_cont_call): restore tracing status. [Feature #4347] * test/ruby/test_continuation.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24* parse.y: added symbols and qsymbols productions for %i and %Itenderlove
support. %i{ .. } returns a list of symbols without interpolation, %I{ .. } returns a list of symbols with interpolation. Thanks to Josh Susser for inspiration of this feature. [Feature #4985] * ext/ripper/eventids2.c: added ripper events for %i and %I. * test/ripper/test_parser_events.rb: ripper tests * test/ripper/test_scanner_events.rb: ditto * test/ruby/test_array.rb: test for %i and %I behavior git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20remove garbage spacesnobu
* insns.def, parse.y: remove garbage spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18* parse.y (primary): allow an empty grouped expression as theshugo
operand of the not operator (e.g., not ()). [ruby-core:45976] [Bug #6674] * parse.y (parser_yylex): show no warning for a grouped expression as the operand of the not operator (e.g., not (a)) or as an argument of a method call without parentheses (e.g., foo (a)). [ruby-core:39050] [Bug #5214] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-07[Feature #6693]nobu
* parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for variables starting with _. [ruby-core:46160][Feature #6693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21parse.y: fix GC problem of keyword rest argumentnobu
* parse.y (new_args_tail_gen): fix GC problem of keyword rest argument. the wrapped struct should be bound to the wrapping node before assignment of child nodes, to get rid of the case the children are referred by only the struct pointer which is not a subject of GC. [ruby-core:45744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-14Bug #6403: reset states after empty argsnobu
* parse.y (f_arglist): should reset lexical states after empty argument list with no parenthesis as well as parenthesized list, so that reserved name method definition work. [ruby-dev:45626] [Bug #6403] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11Bug #6419: fix cmdarg beginnobu
* parse.y (primary): begin/end block should be isolated from outside. [ruby-dev:45631][Bug #6419] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10parse.y: debugging stuffnobu
* parse.y (lex_state_name): returns name for lex_state_e, for debug use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-02* parse.y (parser_yylex): allow spaces between lambda arrow andnobu
parenthesis. [ruby-dev:45605][Feature #6390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-28* parse.y (assoc, parser_yylex): add syntax to splat keyword hash.nobu
[ruby-core:44591][Feature #6353] * compile.c (compile_array_): generate keyword splat insns. * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate hash. leftward argument is prior currently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* parse.y (parser_yylex): EXPR_BEG by keywords is a start point ofnobu
commands. [ruby-dev:45563][Bug #6347] * parse.y (superclass): ditto for superclass. * parse.y (parser_parse_string, parser_here_document): ditto for string interpolation. * parse.y (parser_yylex): ditto for singleton class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23* parse.y (primary): remove wrong "fixpos" that caused incorrectmame
source_location of blocks. [ruby-core:42232] [Bug #5930] * test/ruby/test_proc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12* compile.c (compile_array, compile_array_):ko1
Divide big array (or hash) literals into several blocks and concatetene them. There was a problem that a big array (hash) literal causes SystemStackError exception (stack overflow) because VM push all contents of the literal onto VM stack to make an array (or hash). To solve this issue, we make several arrays (hashes) and concatenate them to make a big array (hash) object. ?? * compile.c (iseq_compile_each, setup_args): use modified compile_array. * vm.c (m_core_hash_from_ary, m_core_hash_merge_ary, m_core_hash_merge_ptr): added for above change. * id.c (Init_id), parse.y: add core method ids. * bootstraptest/test_literal.rb: add simple tests. * bootstraptest/test_eval.rb: remove rescue clause to catch SystemStackError exception. * test/ruby/test_literal.rb: add tests to check no stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11* parse.y (rb_check_id_cstr): new function to check if ID isnobu
registered with NUL-terminated C string. * sprintf.c (rb_str_format): avoid inadvertent symbol creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09* parse.y (string_content, parser_yylex): count brace nesting tonobu
dispatch embexpr_end. [ruby-core:43775][Bug #6211] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16fix unreachable warning line numbernobu
* parse.y (block_append_gen): fix unreachable warning line number. should warn at the code, not jump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* parse.y (parser_yylex): fix warning line number.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* parse.y (sym_check_asciionly): check ascii compatibility beforenobu
scanning for code range. * parse.y (intern_str): set to us-ascii if ascii only. [ruby-dev:45363][Bug #6146] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13fix rippernobu
* parse.y (new_args_gen, new_args_tail_gen): fix ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13* compile.c (iseq_set_arguments): keyword rest arg without keyword args.nobu
* node.c (dump_node): dump kw_rest_arg too. * parse.y (block_param, f_arg): more kwrest patterns. [ruby-core:42455][Bug #5989] * parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13* parse.y (block_param, f_args): add rules for the case argumentsnobu
begin with kwrest. [ruby-core:42455][Bug #5989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flagsnobu
has been already obsolete. patch by Thomas Enebo. [ruby-core:41929][Bug #5847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06* parse.y (parser_tokadd_string): escape simple regexp metanobu
character termninators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05* parse.y (block_call): rules for block_call after block_call.nobu
based on a patch by pasberth https://github.com/ruby/ruby/pull/102 [ruby-dev:45308][Bug #6115] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05* parse.y (block_command, block_call): simplified rules.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-04* parse.y (parser_tokadd_string): regexp engine doesn't neednobu
terminators to be escaped. [ruby-core:40364][Bug #5484] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* parse.y (opt_bv_decl): allow newline at the end. [ruby-dev:45292]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* parse.y (parser_tokadd_string): insert a backslash only ifnobu
quoted by single quotes. [ruby-dev:45281] [Bug #6069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23* parse.y (parser_tokadd_string, parser_yylex): insert a backslashnobu
if the next character is non-ascii. [ruby-dev:45278] [Bug #6069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-01* parse.y (debug_lines, coverage): set file path encoding for coveragemame
result. [ruby-dev:44950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-22* parse.y (rb_intern3): split to registration check and newnobu
registration. * parse.y (rb_intern_str): make interned string shared with the given string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-22* parse.y (rb_intern3, rb_intern_str): check the coderange first.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-27* node.h (rb_args_info): change pre_args_num and post_args_num asnobu
int, to match with rb_iseq_t. * parse.y (new_args_gen): check overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* node.h, node.c, parse.y: implement a parser part for keyword arguments. ↵mame
This is a preparation for keyword argument (see [ruby-core:40290]). * gc.c (gc_mark_children): bookkeeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use struct ↵mame
rb_args_info instead of NODEs. This is a preparation for keyword argument (see [ruby-core:40290]). * node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack. This is a ↵mame
preparation for keyword argument (see [ruby-core:40290]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e