summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2013-08-10parse.y: non-local/const attrsetnobu
* parse.y (rb_id_attrset): allow other than ID_ATTRSET. * parse.y (intern_str): ditto. try stem ID for ID_INSTANCE, ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-10parse.y: check for attrnobu
* parse.y (rb_id_attrset): check if the argument is valid type as an attribute. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-03parse.y: no reduction with 1nobu
* parse.y (parser_set_integer_literal): use rb_rational_raw1() for integral rational because no reduction is needed with 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* parse.y (value_expr_gen): now NODE_DEFN and NODE_DEFS are not voidusa
value expressions. get rid of wrong warning with -w, and make to pass tests with chkbuild. ref. [Feature #3753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02parse.y: calculate powers of tennobu
* parse.y (parser_yylex): calculate denominator directly as powers of ten, not parsing string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02parse.y: ripper for new literalsnobu
* 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
2013-08-02parse.y: parse preciselynobu
* 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
2013-08-02parse.y: simplify numericsnobu
* parse.y (simple_numeric): integrate numeric literals and simplify numeric rules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switchcharliesome
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
2013-08-01* rational.c (rb_flt_rationalize_with_prec): new public C functionmrkn
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
2013-07-31* parse.y: fix build error with bison-3.0.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29parse.y, vm_eval.c: file encoding in evalnobu
* 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
2013-07-26parse.y: separate numeric literalnobu
* 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
2013-06-24* compile.c (make_name_for_block): use PRIsVALUE in format stringcharliesome
instead of %s and RSTRING_PTR to protect objects from being garbage collected too soon * encoding.c (str_to_encindex): ditto * hash.c (rb_hash_fetch_m): ditto * io.c (rb_io_reopen): ditto * parse.y (reg_fragment_check_gen): ditto * parse.y (reg_compile_gen): ditto * parse.y (ripper_assert_Qundef): ditto * re.c (rb_reg_raise): ditto * ruby.c (set_option_encoding_once): ditto * vm_eval.c (rb_throw_obj): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18parse.y: clear lex_strtermnobu
* 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
2013-06-12parse.y: non-shady ruby_debug_linesnobu
* 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
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02fill rdocsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14parse.y: fix argument typenobu
* 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
2013-05-13* include/ruby/ruby.h: constify RBasic::klass and addko1
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
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-10parse.y: invalid name as mere stringnobu
* 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
2013-05-10parse.y: lex_state macrosnobu
* 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
2013-05-08parse.y: fail if invalid namenobu
* 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
2013-04-24parse.y: setup_fake_strnobu
* parse.y (setup_fake_str): extract function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-24parse.y: disallow $-nobu
* 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
2013-04-10parse.y: mrhs_argnobu
* parse.y (mrhs_arg): reduce duplicated code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05parse.y: "nil" for defined? with empty expressionnobu
* 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
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