* parse.y (ripper_validate_object): ripper support for new literals,
tRATIONAL and tIMAGINARY.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_number_literal_suffix): return bit set of found
suffixes.
* parse.y (parser_set_number_literal, parser_set_integer_literal):
split from parser_number_literal_suffix to set yyvlal.
* parse.y (parser_yylex): parse rational number literal with decimal
point precisely.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
statement, and call rb_bug() if an unknown type is passed to
negate_lit(). [ruby-core:56316] [Bug #8717]
* bootstraptest/test_literal_suffix.rb (assert_equal): add test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to rationalize a Float instance with a precision.
* rational.c (rb_flt_rationalize): new public C function to
rationalize a Float instance. A precision is calculated from
the given float number.
* include/ruby/intern.h: Add rb_flt_rationalize_with_prec and
rb_flt_rationalize.
* parse.y: implement number literal suffixes, 'r' and 'i'.
[ruby-core:55096] [Feature #8430]
* bootstraptest/test_literal_suffix.rb: add tests for parser to scan
number literals with the above tsuffixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (yycompile): store file name as String to keep the encoding.
* parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path):
new functions to pass file name as a String.
* parse.y (gettable_gen): return a copy of the original file name, not
a copy in filesystem encoding.
* vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): separate numeric literal from succeeding
token, and treat 'e' as floating point number only if followed by
exponent part.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_heredoc_restore): clear lex_strterm always to get
rid of marking recycled node. this bug is revealed by r41372 with
GC.stress=true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_set_encode): get rid of making ruby_debug_lines
non-shady.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (is_global_name_punct): fix argument type, to get rid of
implicit promotion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_peek_variable_name): treat invalid global, class,
and instance variable names as mere strings rather than errors.
[ruby-core:54885] [Bug #8375]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): use IS_lex_state() and IS_lex_state_for()
instead of direct comparison.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): fail if $, @, @@ are not followed by a valid
name character. [ruby-core:54846] [Bug #8375].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): disallow $- without following identifier
character. [ruby-talk:406969]
* parse.y (is_special_global_name): mere $- is not a valid global
variable name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_defined): remove all extra parentheses, and return
"nil" for defined? with empty expression.
[ruby-core:54024] [Bug #8224]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
* 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