aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* 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
* parse.y: lparen_arg statementnobu2016-08-191-1/+1
| | | | | | | * parse.y (primary): allow parenthesised statement as a method argument. [Feature #12686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: chained assignmentsnobu2016-08-131-22/+22
| | | | | | | * parse.y (command_asgn, arg): fix syntax errors with chained assignment with op assign. [Bug #12669] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue modifier in rhs of op asgnnobu2016-08-131-14/+14
| | | | | | | * parse.y (stmt, arg): rescue modifier in command op assignment should be limited to rhs only. [ruby-core:75621] [Bug #12402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: const_decl_gennobu2016-08-121-3/+11
| | | | | | | * parse.y (const_decl_gen): extract as a function as well as ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: assign_errornobu2016-08-121-6/+6
| | | | | | * parse.y (assign_error_gen): [ripper] rename without backref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: node_assignnobu2016-08-111-8/+0
| | | | | | | * parse.y (stmt, command_asgn): unifiy parser and ripper code by node_assign macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: backref_assign_errornobu2016-08-111-32/+23
| | | | | | * parse.y (backref_assign_error): unify parser and ripper code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: const declaration macronobu2016-08-111-44/+19
| | | | | | * parse.y (const_decl): unify parser and ripper code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: const field macrosnobu2016-08-111-19/+10
| | | | | | | * parse.y (const_path_field, top_const_field): unify parser and ripper code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rhs with rescue modifiernobu2016-08-101-41/+33
| | | | | | | * parse.y (command_rhs, arg_rhs): introduce new rules to reduce repeated rules with rescue modifier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue modifier in rhsnobu2016-08-101-0/+12
| | | | | | | * parse.y (command_asgn): rescue modifier in command assignment should be limited to rhs only. [ruby-core:75621] [Bug #12402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: reg_fragment_enc_errornobu2016-08-031-12/+40
| | | | | | | * parse.y (reg_fragment_enc_error): compile_error is different between parser and ripper. [ruby-core:76397] [Bug #12651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: revisit the structure of frame, block and env.ko12016-07-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | [Bug #12628] This patch introduce many changes. * Introduce concept of "Block Handler (BH)" to represent passed blocks. * move rb_control_frame_t::flag to ep[0] (as a special local variable). This flags represents not only frame type, but also env flags such as escaped. * rename `rb_block_t` to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects wb-protected. Check [Bug #12628] for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Coverage on non-positive linesnobu2016-06-261-1/+1
| | | | | | | | | * compile.c (ADD_TRACE): ignore trace instruction on non-positive line. * parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e