aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: ripper_intern is no longer usednobu2017-02-121-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: logopnobu2017-02-121-21/+8
| | | | | | | | | * 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
* parse.y: call_bin_opnobu2017-02-121-100/+13
| | | | | | | * 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
* parse.y: call_uni_opnobu2017-02-121-37/+15
| | | | | | | | | * 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
* ripper: fix %-op on_operator_ambiguousnobu2017-02-121-22/+16
| | | | | | | | | * 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
* parse.y: TOKEN2IDnobu2017-02-111-148/+53
| | | | | | | | | * 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
* parse.y: fix idCOLON2nobu2017-02-091-1/+1
| | | | | | | | * 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
* parse.y: named caputre into match_op_gennobu2017-02-081-7/+4
| | | | | | | * 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
* parse.y (parser_yylex): remove wrong warningnobu2017-01-241-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue/else/ensure in do-endnobu2017-01-191-1/+1
| | | | | | | * 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
* parse.y: chomp by -lnobu2017-01-191-3/+3
| | | | | | | * 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
* parse.y: warn spacenobu2017-01-191-0/+7
| | | | | | * 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
* parse.y: preserve cmdarg stacknobu2016-12-261-1/+1
| | | | | | | * 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
* fix r57089nobu2016-12-161-1/+1
| | | | | | | * 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
* multiline heredoc identifiernobu2016-12-161-2/+9
| | | | | | | * 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
* parse.y: newline in heredoc identifiernobu2016-12-151-0/+5
| | | | | | | * 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
* parse.y: one warning, one line [ci skip]nobu2016-12-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: curtail scanningnobu2016-12-141-2/+5
| | | | | | | * 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
* parse.y: fix yyerror messagenobu2016-12-141-3/+2
| | | | | | | * 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
* parse.y: zero codepointsnobu2016-12-111-2/+3
| | | | | | | * 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
* parse.y: ripper generic inputnobu2016-12-081-1/+17
| | | | | | | * 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
* parse.y: simplify parsing utf-8 stringnobu2016-12-021-37/+21
| | | | | | | * 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
* parse.y: relax spacesnobu2016-12-021-1/+5
| | | | | | | * 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
* parse.y: reject invalid codepointnobu2016-12-011-5/+16
| | | | | | | * 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
* parse.y: refine error messagenobu2016-11-301-5/+5
| | | | | | | * 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
* parse.y: parser_tokadd_codepointnobu2016-11-301-22/+22
| | | | | | | * 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
* parse.y: brace constantsnobu2016-11-301-3/+4
| | | | | | * 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
* parse.y: no warning for lambdanobu2016-11-301-3/+5
| | | | | | | * 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
* parse.y: ambiguous parenthesesnobu2016-11-291-0/+4
| | | | | | | * 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
* parse.y: warn ? followed by a wordnobu2016-11-221-2/+14
| | | | | | | * 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
* Revert r56856nobu2016-11-211-2/+2
| | | | | | * parse.y: tCHAR can be concatenated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: tCHAR cannot be concatenatednobu2016-11-211-2/+2
| | | | | | | * 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
* parse.y: new_attr_op_assign in ripper needs symbolnobu2016-11-101-2/+4
| | | | | | | | * 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
* parse.y: fix restored cmdarg_stacknobu2016-11-051-2/+2
| | | | | | | | | * 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
* parse.y: !-operator warningnobu2016-10-291-21/+25
| | | | | | | * 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
* parse.y: append to buffernobu2016-10-221-6/+1
| | | | | | | * 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
* compile.c: literal rangenobu2016-10-011-54/+0
| | | | | | | * 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
* parse.y: deferred_dots_gennobu2016-09-291-8/+17
| | | | | | * 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
* parse.y: fix up r56198nobu2016-09-271-4/+5
| | | | | | | | | | | * 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
* parse.y: preserve cmdarg_stacknobu2016-09-211-2/+12
| | | | | | | | * 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
* parse.y: do after cmdarg in parennobu2016-09-211-1/+1
| | | | | | | * 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
* parse.y: remove spaces [ci skip]nobu2016-09-211-2/+2
| | | | | | | * 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
* parse.y: block bodiesnobu2016-09-211-41/+33
| | | | | | * parse.y (brace_body, do_body): extract block bodies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: heredoc tokennobu2016-08-261-3/+5
| | | | | | | * parse.y (parser_heredoc_identifier): gather branches by quote char. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: STR_TERM_ENDnobu2016-08-261-3/+4
| | | | | | | * parse.y (parser_parse_string): store the end of string literal mark in nd_term instead of nd_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: parser_string_termnobu2016-08-261-4/+10
| | | | | | | * parse.y (parser_string_term): return the token of string or regexp literal terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reset indent in heredoc_dedentnobu2016-08-261-15/+15
| | | | | | | * parse.y (parser_heredoc_dedent): reset heredoc_indent and return the dedented node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: new_string1nobu2016-08-261-5/+3
| | | | | | * parse.y (new_string1): extract from the rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: new_xstring_gennobu2016-08-261-25/+33
| | | | | | * parse.y (new_xstring_gen): extract from the rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: new_regexp_gennobu2016-08-261-73/+87
| | | | | | * parse.y (new_regexp_gen): extract from the rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e