summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2013-03-21parse.y: refine warning messagenobu
* parse.y (ambiguous_operator): refine warning message, since this warning is shown after literal too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-21parse.y: escape all closing parensnobu
* parse.y (simple_re_meta): escape all closing characters, not only round parenthesis. [ruby-core:53578] [Bug #8133] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-12required keyword argumentsnobu
* compile.c (iseq_set_arguments, iseq_compile_each): support required keyword arguments. [ruby-core:51454] [Feature #7701] * iseq.c (rb_iseq_parameters): ditto. * parse.y (f_kw, f_block_kw): ditto. this syntax is still experimental, the notation may change. * vm_core.h (rb_iseq_struct): ditto. * vm_insnhelper.c (vm_callee_setup_keyword_arg): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-26parse.y: keyword argument without parennobu
* parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just after method definition without a parenthesis. [ruby-core:52820] [Bug #7942] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16* parse.y: add dtrace probe for symbol create.tenderlove
* probes.d: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-31parse.y: no assigned but unused warnings in evalnobu
* parse.y (local_push_gen): no assigned but unused variable warnings in eval as well as -e. [Feature #7730] [ruby-core:51580] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-30parse.y: warn assigned but unused in toplevelnobu
* parse.y (local_push_gen): warn assigned but unused variables also in toplevel, except for -e option. [Feature #7730] [ruby-core:51580] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-11* string.c (dispose_string): use rb_str_free for freeing string innaruse
parse.y. by Sokolov Yura <funny.falcon@gmail.com> https://github.com/ruby/ruby/pull/87 fix GH-87 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07parse.y: bare kwrest_marknobu
* parse.y (f_kwrest): allow bare kwrest_mark as valid syntax. its semantics is still undefined. [Bug #7662] [ruby-core:51269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07parse.y: duplicated kwrest namenobu
* parse.y (f_kwrest): reject duplicated kwrest argument name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30parse.y: escaped closing parenthsisnobu
* parse.y (simple_re_meta): escaped closing parenthsis has different meaning. [Bug #7610] [ruby-core:51088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29use RB_TYPE_Pnobu
* enumerator.c (enumerator_initialize), eval.c (rb_using_refinement), (add_activated_refinement), numeric.c (num_interval_step_size), parse.y (arg, match_op_gen, cond0), range.c (range_bsearch), vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24scoped constant op-assignmentnobu
* node.h (NODE_OP_CDECL), compile.c (iseq_compile_each), parse.y (stmt, arg): allow scoped constant op-assignment. [ruby-core:40154] [Bug #5449] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15* parse.y (yycompile0): adjust indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14parse.y: fix line numbernobu
* parse.y (parser_params): parser_tokline to track the line number at which token started. [ruby-dev:46737] [Bug #7559] * parse.y (fcall): operation with starting line number. * parse.y (command, primary, method_call): point method name line. * parse.y (gettable_gen): return token line for __LINE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06parse.y: flush string contentnobu
* parse.y (parser_here_document): flush string content between new line and :string_embexpr. [ruby-core:48703] [Bug #7255] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-04* parse.y: replase parser->enc with current_enc.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-02* array.c, enum.c, insns.def, io.c, numeric.c, parse.y, process.c,ko1
range.c: use prepared IDs. A patch from charliesome (Charlie Somerville). [Bug #7495] * common.mk: add dependency to id.h. * common.mk: replace ID_H_INCLUDES with id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* parse.y (parser.utf8): remove unused property.naruse
* parse.y (UTF8_ENC): remove unused macro. * parse.y (parser_tokadd_utf8): use rb_utf8_encoding() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30parse.y: false usage of local variablenobu
* parse.y (parser_yylex): fix false usage of local variable, it cannot appear in fname state [ruby-core:49659] [Bug #7408] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30parse.y: LVAR_USEDnobu
* parse.y (LVAR_USED): use MSB of ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30parse.y: IS_lex_state_fornobu
* parse.y (IS_lex_state_for): new macro similar to IS_lex_state() but for arbitrary variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 * include/ruby/util.h: removed extra semicolon in definition oftadf
macro. * compile.c: ditto. * cont.c: ditto. * math.c: ditto. * node.c: ditto. * parse.y: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12* probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-09* parse.y (warn_balanced): use bit-wise operation.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* ruby.c (load_file_internal): set default source encoding asnaruse
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27parse.y: warn static content assign in condnobu
* parse.y (assign_in_cond): warn for static content object asignments in conditional statements. [ruby-dev:43083] [Feature #4299] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27* iseq.c (rb_iseq_compile_with_option): Instead of testingshyouhei
respond_to, just check if the argument is actually a file, because by calling user-defined gets something weired can happen. Patch by Glass_saga. [ruby-dev:40202] [Bug #2861] * parse.y (ripper_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27parse.y: bit field lex_statenobu
* parse.y (enum lex_state_e): [EXPERIMENTAL] lex_state as bit field / IS_lex_state() macro. based on the patch by Dave B in [ruby-core:23503]. [Feature #1493] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26parse.y: concatenated literalsnobu
* parse.y (literal_concat_gen): merge fixed strings across concatenated literals, after an interpolation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25Revert r37316naruse
The commit introduces too many failures and disturbs release engineering. Re-commit it with fixed tests. Thu Oct 25 13:09:01 2012 NAKAMURA Usaku <usa@ruby-lang.org> * parse.y: show a warning for concatenating string literals because it will be deprecated in the future. patched by mame (Yusuke Endoh) at [ruby-core:44207]. [ruby-core:44156] [Feature #6265] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25* parse.y: show a warning for concatenating string literals becauseusa
it will be deprecated in the future. patched by mame (Yusuke Endoh) at [ruby-core:44207]. [ruby-core:44156] [Feature #6265] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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