* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
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
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
* 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
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
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
* 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
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
(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
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
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
* 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
* 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
* 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
* 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
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
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
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
* 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
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
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
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
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
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
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
that checks in core would work. [ruby-core:39591] [Bug #5331]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
routines. a patch from Michael Edgar. [Bug #5303]
[ruby-core:39429]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which prefixes an non-ascii character, which has no escape
syntax. [ruby-core:39222] [Ruby 1.9 - Bug #5262]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
based on the second patch by Jeremy Evans at [ruby-core:38447]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
avoid inadvertent symbol creation in reflection methods. based
on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072]
* vm_method.c (rb_mod_method_defined)
(rb_mod_{public,private,protected}_method_defined)
(obj_respond_to): ditto.
* parse.y (rb_check_id): new function returns already interned ID
or 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
references. based on a patch by Michael Edgar michael.j.edgar
AT dartmouth.edu. Bug #5002
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reduced when there is an else clause. This caused bizarre behavior
in [Bug #4473] [ruby-core:35629] [ruby-core:37884].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
modifiers. patched by michael.j.edgar AT dartmouth.edu at
[ruby-core:36248]. fixed#4716.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
A patch from Yukihiro Matsumoto <matz AT ruby-lang.org>.
(fixed#3456).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patch by Masaya Tarui in [ruby-dev:43762]. Bug #4544
* parse.y (yylex): revert r24557. delayed token at the end of
string should be flushed already by the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
magic comment's emacs newline specifier
patched by James M. Lawrence [ruby-core:35476] fixes#4489
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"-dos" and "-mac" is not 5 but 4.
patched by James M. Lawrence [ruby-core:35476] fixes#4489
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c, include/ruby/intern.h (rb_compile_error_with_enc): new
function to raise syntax error, with source encoding'ed message.
* parse.y (compile_error): use above function.
[ruby-core:33951] (#4217)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
restructued to add declared line. [ruby-dev:42718]
* parse.y (shadowing_lvar_gen): should not add dvar to vars.
* parse.y (local_push_gen, local_id_gen, dvar_defined_gen): check
local variable usage for args and vars respectedly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
used in ripper.
* node.h (rb_parser_{malloc,realloc,calloc,free}): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit r28339 and r28340
because they prevents test-all on boron.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
if block argument is passed. [ruby-core:30534]
* parse.c (arg_concat_gen): should append to nd_head, not to
nd_iter for NODE_BLOCK_PASS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
containing symbol literals, as well as String#to_sym.
[ruby-dev:41447]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
octal encoded character after \c. This seemed to be prohibited at
r13836, but its ChangeLog mentions nothing about this prohibition.
So I assume this prohibition is not intended. [ruby-core:27229]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-core:24621]
* test/ruby/test_m17n_comb.rb: modify a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
non-toplevel scope. [ruby-core:21657]
* test/ruby/test_beginendblock.rb (test_begininclass): add a test for
above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for the case of syntax errors in method name or argument inside
do block. [ruby-core:26961]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
numeric literal without digits. based on a patch from ujihisa .
in [ruby-dev:39811]. [ruby-dev:39798]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
contents. based on a patch from Andy Keep in [ruby-core:24855].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e