summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2018-03-21merge revision(s) 61862: [Backport #14368]nagachika
parse.y (new_regexp): Fix SEGV of `/#{"\u3042"}#{'{U+3044}'}/` in non UTF-8 Mixing other encoding string literals in one Regexp caused SEGV. This bug was found by CoverityScan. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19merge revision(s) 61346: [Backport #14206]nagachika
parse.y: end of script at newline * parse.y (parser_yylex): deal with end of script chars just after ignored newline as other places. [ruby-core:84349] [Bug #14206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-07merge revision(s) 60160: [Backport #13998]nagachika
parse.y: token info with BOM * parse.y (parser_prepare): set token_info_enabled flag first, before returning at BOM. [ruby-dev:50288] [Bug #13998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16merge revision(s) 57733,57734: [Backport #13782]nagachika
kwrest arg name * 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. fix nd_ainfo->kw_rest_arg [Fix GH-5129] Author: fate0 <fate0@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-03merge revision(s) 60213: [Backport #14032]nagachika
parse.y: indent at '#' * parse.y (parser_here_document): update indent at '#', which is not a space. [ruby-core:83368] [Bug #14032] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-24merge revision(s) 60071: [Backport #13953] [Backport #13954] [Backport ↵nagachika
#13955] [Backport #13957] ext: check if null byte is contained [ruby-dev:50267] [Bug #13953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-03merge revision(s) 58499,58500: [Backport #13181]nagachika
parse.y: fix line in rescue * parse.y (set_line_body, primary): fix line number of bodystmt as the beginning of the block. [ruby-core:79388] [Bug #13181] parse.y: set_line_body is not used in ripper git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@60626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11merge revision(s) 59375: [Backport #13756]nagachika
parse.y: empty hash in defined * parse.y (command): NODE_ARRAY with NULL is invalid. traversal in defined_expr0 is simplified than iseq_compile_each0. [ruby-core:82113] [Bug #13756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-10merge revision(s) 59644: [Backport #13836]nagachika
parse.y: primary should not be 0 * parse.y (primary): should not be 0, since it can be a receiver. [ruby-core:82447] [Bug #13836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-05merge revision(s) 58561: [Backport #13540]nagachika
parse.y: make shared string modifiable * parse.y (dedent_string): ensure that the string is modifiable, not to set the length of shared string. [ruby-core:80987] [Bug #13540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-23merge revision(s) 58641: [Backport #13547]nagachika
parse.y: brace after literal arg * parse.y (symbol, dsym, parser_set_number_literal, parser_yylex): set state to END too not only ENDARG and after a literal, so that a left brace after it should be a primary block bound to the literal, which causes syntax error. [ruby-core:81037] [Bug #13547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-23merge revision(s) 58638,58640: [Backport #11873]nagachika
test_syntax.rb: test_brace_after_local_variable * test/ruby/test_syntax.rb (test_brace_after_local_variable): another test using braces. [Bug #11873] parse.y: do after cmdarg in paren * parse.y (parser_yylex): set state to ENDARG after a string literal, so that `do` after a literal should be `do_block` and bound to the outer method, as well as a numeric/symbol literal. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-23merge revision(s) 59161: [Backport #13672]nagachika
parse.y: check multibyte char * parse.y (parser_precise_mbclen): check invalid multibyte char at skipping strings following `?x` literal string, not to stuck in a infinite loop. [ruby-core:81746] [Bug #13672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-12merge revision(s) 57801: [Backport #13287]naruse
parse.y: remove trace * 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/branches/ruby_2_4@57934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-12merge revision(s) 57717: [Backport #13253]naruse
parse.y: indent at invalid identifier * 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/branches/ruby_2_4@57912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-11merge revision(s) 57198: [Backport #13073]naruse
parse.y: preserve cmdarg stack * 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/branches/ruby_2_4@57837 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
2016-09-21parse.y: block bodiesnobu
* 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
2016-08-26parse.y: heredoc tokennobu
* 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
2016-08-26parse.y: STR_TERM_ENDnobu
* 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
2016-08-26parse.y: parser_string_termnobu
* 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
2016-08-26parse.y: reset indent in heredoc_dedentnobu
* 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