summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2017-03-13parse.y: relax `&' warningnobu
* parse.y (parser_yylex): disable "`&' interpreted as argument prefix" warning when just followed by a symbol literal. [ruby-core:79926] [Misc #13283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07parse.y: remove tracenobu
* parse.y (reg_named_capture_assign_iter): do not insert trace instructions before local variable assinments. putobject is expected at first. [ruby-core:79940] [Bug #13287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-27kwrest arg namenobu
* compile.c (iseq_set_arguments_keywords): make keyword rest argument name nd_vid consistently, regardless of whether other keyword arguments are present. [Fix GH-1529] * parse.y (new_args_tail_gen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-26parse.y: indent at invalid identifiernobu
* parse.y (parser_heredoc_identifier): set indent only when valid identifier, not to dedent non-existent contents later. [ruby-core:79772] [Bug #13253] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20Cast as VALUE to suppress type warningsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20They are enum yytokentype, need castnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20parse.y: new_qcallnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-20parse.y: ID2VALnobu
* parse.y (ID2VAL): split from TOKEN2VAL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12parse.y: ripper_intern is no longer usednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12parse.y: logopnobu
* defs/id.def (predefined): add keywords `and` and `or`. * parse.y (log_op): unify parser and ripper, and use tokens instead of node types and symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12parse.y: call_bin_opnobu
* parse.y (call_bin_op): unify parser and ripper, and use IDs instead of tokens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12parse.y: call_uni_opnobu
* defs/id.def (predefined): add keyword `not`. * parse.y (call_uni_op): unify parser and ripper, and use IDs instead of tokens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12ripper: fix %-op on_operator_ambiguousnobu
* parse.y (ambiguous_operator): separate token and string representation of operators, to fix %-operator argument. in a warning message, needs to be escaped by '%' but the symbol should not be. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-11parse.y: TOKEN2IDnobu
* parse.y (TOKEN2ID): add macro which maps static tokens to IDs. * template/id.h.tmpl (TOKEN2*ID, DEFINE_*ID_FROM_TOKEN): separate into macros, token to ID mapping and enum definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-09parse.y: fix idCOLON2nobu
* defs/id.def: remove idDSTAR and idCOLON3. * parse.y (tCOLON2): make same as id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-08parse.y: named caputre into match_op_gennobu
* parse.y (match_op_gen): move making named capture assignment nodes. remove repeated conditions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-24parse.y (parser_yylex): remove wrong warningnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-19parse.y: rescue/else/ensure in do-endnobu
* parse.y (do_body): allow rescue/else/ensure inside do/end blocks. [Feature #12906] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-19parse.y: chomp by -lnobu
* parse.y (rb_parser_while_loop): should chomp but not chop by -l option. [ruby-core:78099] [Bug #12926] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-19parse.y: warn spacenobu
* parse.y (parser_yylex): warn parentheses after space. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-26parse.y: preserve cmdarg stacknobu
* parse.y (do_body): preserve cmdarg stack around do/end block. [ruby-core:78837] [Bug #13073] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16fix r57089nobu
* parse.y (parser_heredoc_identifier): fix multiline here document identifier condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16multiline heredoc identifiernobu
* parse.y (parser_heredoc_identifier): reject multiline here document identifier, which never matches single line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-15parse.y: newline in heredoc identifiernobu
* parse.y (parser_heredoc_identifier): warn newline in here document identifier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-15parse.y: one warning, one line [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-14parse.y: curtail scanningnobu
* parse.y (parser_yyerror): curtail scanning range, not to exceed the max margin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-14parse.y: fix yyerror messagenobu
* parse.y (parser_yyerror): show the error line even if the error is at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-11parse.y: zero codepointsnobu
* parse.y (parser_tokadd_utf8): relax restriction to allow zero or more codepoints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-08parse.y: ripper generic inputnobu
* parse.y (ripper_initialize): allow generic input as source, if it has #gets method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02parse.y: simplify parsing utf-8 stringnobu
* parse.y (parser_tokadd_codepoint): move error checks and add char. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02parse.y: relax spacesnobu
* parse.y (parser_tokadd_utf8): relax restriction spaces inside "\u{...}". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01parse.y: reject invalid codepointnobu
* parse.y (parser_tokadd_codepoint): reject invalid codepoint, surrogate blocks and surrogate pair, as well as mruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30parse.y: refine error messagenobu
* parse.y (parser_tokadd_utf8): refine error message at bad char in unicode escape, "invalid" instead of "unterminated". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30parse.y: parser_tokadd_codepointnobu
* parse.y (parser_tokadd_codepoint): extract from parser_tokadd_utf8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30parse.y: brace constantsnobu
* parse.y (parser_tokadd_utf8): make open/close braces constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30parse.y: no warning for lambdanobu
* parse.y (parser_yylex): do not warn parentheses of lambda argument list, because there is no name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29parse.y: ambiguous parenthesesnobu
* parse.y (parser_yylex): warn ambiguous parentheses after a space in method definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22parse.y: warn ? followed by a wordnobu
* parse.y (parse_qmark): warn `?` with unbalanced space, which is interpreted as a conditional operator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21Revert r56856nobu
* parse.y: tCHAR can be concatenated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21parse.y: tCHAR cannot be concatenatednobu
* parse.y (strings): tCHAR is not a subject of string literal concatenation and string interpolation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-10parse.y: new_attr_op_assign in ripper needs symbolnobu
* parse.y (command_asgn, arg): new_attr_op_assign in ripper expects a Symbol VALUE as the operator, not an ID, so convert literal IDs to Symbols. [ruby-core:78069] [Bug #12916] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05parse.y: fix restored cmdarg_stacknobu
* parse.y (brace_body, do_body): since cmdarg_stack is saved in VALUE val, should restore from the same member. on big-endian platforms where VALUE is larger than int, it restored 0 in the upper word. [ruby-core:77920] [Bug #12900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-29parse.y: !-operator warningnobu
* parse.y (cond0): !-operator is a method call, no warning for literal in condition. [ruby-core:77801] [Bug #12881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-22parse.y: append to buffernobu
* parse.y (reg_compile_gen): always append error message to the error buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-01compile.c: literal rangenobu
* compile.c (iseq_compile_each): move numeric literal range optimization from fixup_nodes() in parse.y. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-29parse.y: deferred_dots_gennobu
* parse.y (deferred_dots_gen): extract for tDOT2 and tDOT3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-27parse.y: fix up r56198nobu
* parse.y (symbol, dsym, parser_set_number_literal): set state to ENDARG, so that `do` after a literal should be `do_block` and bound to the outer method. [ruby-core:72482] [Bug #11873] * parse.y (parse_ident): revert r56198. * parse.y (warn_balanced): the state of symbol and numeric literals is now EXPR_ENDARG, do not exclude it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-21parse.y: preserve cmdarg_stacknobu
* parse.y (brace_body, do_body): preserve cmdarg_stack so that `do` after cmdarg in a block should be `do_block` and bound to the outer method. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-21parse.y: do after cmdarg in parennobu
* parse.y: `do` after cmdarg in parentheses should be `do_block` and bound to the outer method. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-21parse.y: remove spaces [ci skip]nobu
* parse.y (cmd_brace_block, do_block): remove spaces before tab in indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e