aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* * *.c (*_memsize): do not check ptr.ko12015-12-091-1/+0
| | | | | | | | | | NULL checking is finished Before call of memsize functions. See r52979. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: indented hereocnobu2015-12-071-5/+182
| | | | | | * parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: TAB_WIDTHnobu2015-12-011-1/+3
| | | | | | | * parse.y (TAB_WIDTH, token_info_get_column): add constant for column calcuation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: dispatch heredoc endnobu2015-11-301-10/+4
| | | | | | | | * parse.y (ripper_dispatch_heredoc_end): at the end of here document, the terminator always should present. has_scan_event is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: last content of heredocnobu2015-11-281-0/+4
| | | | | | | * parse.y (parser_here_document): store dispatched result of on_tstring_content at the last fragment of a here document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reduce ifdefsnobu2015-11-271-16/+16
| | | | | | | * parse.y (dispatch_ignored_scan_event, has_delayed_token): more macros to reduce ifdefs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper for warningsnobu2015-11-241-63/+24
| | | | | | | * parse.y (parser_yylex): deal with magic comment warnings also in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix dispatch_scan_eventnobu2015-11-241-1/+1
| | | | | | * parse.y (dispatch_scan_event): fix wrong macro at r52547. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: move logop DCEnobu2015-11-221-28/+1
| | | | | | | | | * compile.c (iseq_peephole_optimize): remove unreachable code chunk after jump/leave. * parse.y: move dead code elimination of logical operation to compile.c. not to warn logical operation of literal constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: optimize condition for unlessnobu2015-11-131-2/+3
| | | | | | | * parse.y (new_unless): optimize constant condition for `unless` as well as `if`. [Fix GH-1092] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: exact magic comment namenobu2015-11-121-1/+1
| | | | | | | * parse.y (parser_magic_comment): should match exactly. [ruby-core:71460] [Bug #11679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ANDDOT fluent interfacenobu2015-11-121-1/+2
| | | | | | | | * parse.y (parser_yylex): ANDDOT at the head of the line denote line continuation from previous one to support fluent interface, as well as single dot. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: simplifynobu2015-11-121-26/+17
| | | | | | * parse.y (parser_yylex): reduce RIPPER ifdefs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename DOTQ to ANDDOTnobu2015-11-101-6/+6
| | | | | | | * defs/id.def, parse.y: Switch internal token name to reflect current form of safe-call operator. [Fix GH-1090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* change DOTQnobu2015-11-061-5/+5
| | | | | | | * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ from ".?" to "&.". [ruby-core:71363] [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix segv after invalid keyword argumentnobu2015-11-061-14/+20
| | | | | | | | * parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: CALL_Q_Pnobu2015-11-051-3/+4
| | | | | | | * parse.y (CALL_Q_P): extract common condition for safe-call token. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: revert lbracketnobu2015-11-031-25/+8
| | | | | | | * parse.y (lbracket): remove .? before aref. [Feature #11537] revert r52422 and r52424 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (NO_QCALL): fix type mismatch of operands that causesngoto2015-11-021-1/+1
| | | | | | | | compile error with Oracle Solaris Studio on Solaris. [Bug #11645] [ruby-dev:49327] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: lbracketnobu2015-11-021-8/+25
| | | | | | * parse.y (lbracket): support .? before aref. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: invalid symbolnobu2015-11-011-1/+1
| | | | | | | * parse.y (parser_yylex): ':' separated by a comment and a newline is not valid as symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: RUBY_DTRACE_HOOKnobu2015-10-311-7/+5
| | | | | | | | | | | * internal.h (RUBY_DTRACE_HOOK): extract from RUBY_DTRACE_CREATE_HOOK for other type hooks. * gc.c (RUBY_DTRACE_GC_HOOK): ditto. * parse.y (RUBY_DTRACE_PARSE_HOOK): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix op_assign typenobu2015-10-281-1/+1
| | | | | | | * parse.y (new_attr_op_assign): fix op_assign type, which is already an ID since r52284. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix rippernobu2015-10-261-12/+32
| | | | | | * parse.y (call_op, call_op2): fix values on ripper. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: call_op2nobu2015-10-261-6/+10
| | | | | | | * parse.y (call_op2): separate from call_op and also allow "::", while dot_or_colon should not allow ".?". [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: canonical namenobu2015-10-231-1/+1
| | | | | | | | * parse.y (parser_magic_comment): intern canonical name. InstructionSequence.compile_options are case-sensitive while pragma names are case-insensitive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* safe navigation attrsetnobu2015-10-231-10/+11
| | | | | | | | | * compile.c (iseq_compile_each): support safe navigation of simple attribute assignment. [Feature #11537] * parse.y (mlhs_node, lhs, attrset_gen): ditto. keep mid non-attrset as the sign of safe navigation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Safe navigation operatornobu2015-10-221-34/+47
| | | | | | | | | | | | | * compile.c (iseq_peephole_optimize): peephole optimization for branchnil jumps. * compile.c (iseq_compile_each): generate save navigation operator code. * insns.def (branchnil): new opcode to pop the tos and branch if it is nil. * parse.y (NEW_QCALL, call_op, parser_yylex): parse token '.?'. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: magic comment w/o indicatorsnobu2015-10-211-6/+19
| | | | | | | * parse.y (parser_magic_comment): allow a sole magic comment without indicators, neither other non-space comments. [Feature #8976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix ripper warningsnobu2015-10-141-95/+52
| | | | | | | | | * parse.y (parser_nextc): send a warning to ripper, not to STDERR always. * parse.y (rb_warn1, rb_warning1): move argument conversions to callers. PRIsVALUE is not valid in String#%. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: move ripper_id2symnobu2015-10-121-7/+7
| | | | | | | * parse.y (new_attr_op_assign): move ripper_id2sym from each rules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reorder conditionsnobu2015-09-291-11/+4
| | | | | | | * parse.y (token_info_pop): scan lex buffer only when token info is enabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: token lengthnobu2015-09-291-14/+16
| | | | | | | * parse.y (token_info_push, token_info_push): add token length parameter instead of strlen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix memory leaknobu2015-09-291-0/+9
| | | | | | | * parse.y (parser_free): fix memory leak at syntax error when warn-indent is enabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: fix minor typo. [ci skip][fix GH-1038].eregon2015-09-291-1/+1
| | | | | | Patch by @ltratt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: marknobu2015-09-291-0/+1
| | | | | | * parse.y (parser_mark): mark compile option hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fronzen-string-literal pragmanobu2015-09-271-2/+36
| | | | | | | | | | | | | * compile.c (iseq_compile_each): override compile option by option given by pragma. * iseq.c (rb_iseq_make_compile_option): extract a function to overwrite rb_compile_option_t. * parse.y (parser_set_compile_option_flag): introduce pragma to override compile options. * parse.y (magic_comments): new pragma "fronzen-string-literal". [Feature #8976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix tokennobu2015-09-241-2/+2
| | | | | | | * parse.y (paren_args): fix separator token at `foo::bar()` in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: simplify ripper_id2symnobu2015-09-191-1/+1
| | | | | | | | * parse.y (ripper_id2sym): remove unnecessary comparison as rb_ispunct has stricter condition, and cast explicitly to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: keep literal encodingnobu2015-09-101-2/+2
| | | | | | | | * parse.y (literal_concat_gen, evstr2dstr_gen): keep literal encoding beginning with an interpolation same as the source file encoding. [ruby-core:70703] [Bug #11519] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix labelargnobu2015-08-181-2/+2
| | | | | | | * parse.y (IS_BEG): include labeled argument state, which was EXPR_LABELARG. [ruby-dev:49221] [Bug #11456] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix block after conditionalnobu2015-08-171-22/+37
| | | | | | | | * parse.y: fix syntax error at do-block after a conditional operator. separate label-allowed and after-a-label states from others as bit flags. [ruby-dev:48790] [Bug #10653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: revert arg in r47649nobu2015-08-171-13/+3
| | | | | | * parse.y (arg): revert a part of r47649. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_parser_compile_*: remove volatile argnormal2015-08-111-7/+7
| | | | | | | | | | | | | | | RB_GC_GUARD is sufficient to prevent tail call optimization from making the object invisible from GC., and we don't need to encourage more volatile usage. * parse.y (rb_parser_compile_cstr): remove volatile arg (rb_parser_compile_string): ditto (rb_parser_compile_file): ditto (rb_parser_compile_string_path): ditto (rb_parser_compile_file_path): ditto [ruby-core:70323] [Misc #11431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: optional superclassnobu2015-08-111-12/+2
| | | | | | | * parse.y (superclass): make superclass rule optional and allow any contents without a terminator. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: shrink parser_paramsnobu2015-08-071-18/+19
| | | | | | | * parse.y (parser_params): turn in_def and in_single into bit flags and reduce the size by 2-words. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove prefixesnobu2015-08-071-133/+135
| | | | | | * parse.y (parser_params): remove redundant prefixes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: require pure parsernobu2015-08-071-14/+6
| | | | | | | * parse.y (yylex): non-pure parser has not been supported since merger of ripper. change argument types from void pointers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: pop cmdargnobu2015-07-231-0/+1
| | | | | | | * parse.y (lambda_body): pop cmdarg stack for lookahead token. [ruby-core:70067] [Bug #11380] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: call rb_intern2nobu2015-07-221-1/+1
| | | | | | | * parse.y (parse_ident): call rb_intern2 with the known length instead of strlen(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e