aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* Fix use of numbered parameter inside proc that is default value of optargJeremy Evans2019-05-051-0/+1
| | | | | | | | | | | | | | | | This allows cases such as: ```ruby m ->(a = ->{@1}) {a} m.call.call(1) m2 ->(a: ->{@1}) {a} m2.call.call(2) ``` Previously, this would cause a syntax error. [Bug#15789]
* Fix a case where numbered parameters should not be allowedJeremy Evans2019-05-051-0/+1
| | | | | | | | | | | | | | | | | | Because `proc{|| @1}` is a syntax error, the following should also be syntax errors: ```ruby proc { | | @1} ``` ```ruby proc { |; a| @1 } ``` This fixes both cases. [Bug #15825]
* parse.y: duplicated when clause warningNobuyoshi Nakada2019-05-051-7/+87
| | | | | * parse.y (case_args): moved "duplicated when clause" warning from compile phase, so that `ruby -wc` shows them.
* Fixed HERETERM_LENGTH_MAX on IL32LLP64Nobuyoshi Nakada2019-04-291-3/+3
|
* Refactored rb_strterm_heredoc_tNobuyoshi Nakada2019-04-291-48/+55
|
* Disallow also CR in here-doc identifierNobuyoshi Nakada2019-04-291-1/+1
| | | | | | * parse.y (heredoc_identifier): CR in here-document identifier might or might not result in a syntax error, by the EOL code. make a syntax error regardless of the EOL code.
* parse.y: fix here-doc identifier with newlineNobuyoshi Nakada2019-04-291-12/+2
| | | | | | | | | | | | | | | * parse.y (heredoc_identifier): quoted here-document identifier must end within the same line. the only corner case that here-document identifier can contain a newline is that the closing qoute is placed at the beginning of the next line, and has been warned since 2.4. ```ruby <<"EOS " # warning: here document identifier ends with a newline EOS ```
* Hide internal IDsNobuyoshi Nakada2019-04-261-1/+2
| | | | | | | | * parse.y (internal_id): number the ID serial for internal use by counting down from the neary maximum value, not to accidentally match permanent IDs. [Bug #15768]
* Ripper does not use internal IDs directlyNobuyoshi Nakada2019-04-251-4/+6
|
* Adjusted indentsNobuyoshi Nakada2019-04-231-11/+11
|
* Disallow numbered parameter as the default value of optional argumentSeiei Miyagi2019-04-231-0/+1
| | | | [Fix GH-2139] [Bug #15783]
* Fix internal error of `->x:@2{}`Seiei Miyagi2019-04-231-0/+1
| | | | [Fix GH-2139] [Bug #15783]
* Missing semicolonNobuyoshi Nakada2019-04-231-0/+1
|
* Avoid usage of the dummy empty BEGIN nodektsj2019-04-201-1/+1
| | | | | | Use NODE_SPECIAL_NO_NAME_REST instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: suppress warningnobu2019-04-181-1/+2
| | | | | | | * parse.y (parser_append_options): explicitly pass $; when auto splitting, to suppress the warning for non-nil $;. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce pattern matching [EXPERIMENTAL]ktsj2019-04-171-1/+713
| | | | | | [ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix fatal messagesnobu2019-04-101-4/+4
| | | | | | | * parse.y (rb_parser_fatal): fix "parser" in the message which was replaced accidentally. it is not the argument name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reverting all commits from r67479 to r67496 because of CI failureskazu2019-04-101-4/+4
| | | | | | | | Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix fatal messagesnobu2019-04-101-4/+4
| | | | | | | * parse.y (rb_parser_fatal): fix "parser" in the message which was replaced accidentally. it is not the argument name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce beginless range [Feature#14799]mame2019-04-031-4/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: show error line separatelynobu2019-03-281-13/+9
| | | | | | | * parse.y: show compile error and the error line separately, instead of building the error message by snprintf then yyerror. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: make tNUMPARAM idnobu2019-03-201-13/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: removed redundant number_arg parser eventnobu2019-03-191-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix var_ref of numbered param in rippernobu2019-03-191-20/+31
| | | | | | | | * parse.y (string_dvar, user_variable): register numbered parameter in ripper for var_ref. [ruby-core:91867] [Bug #15673] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix segv with Ripper#yydebugnobu2019-03-191-1/+1
| | | | | | | | * parse.y (parser_token_value_print): in ripper, ID values are wrapped in NODE_RIPPER at set_yylval_name(), so print the Symbol wrapped together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added Ripper#debug_outputnobu2019-03-191-0/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: numbered parameter in lambdanobu2019-03-181-5/+29
| | | | | | | | * parse.y (lambda): support numbered parameters, only when no argument list including empty parentheses, like empty vertical bars. [ruby-core:91859] [Bug #15672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: continue after invalid namenobu2019-03-181-3/+8
| | | | | | | | * parse.y (set_yylval_noname): continue after an invalid global, instance, class variable name, without "unexpected end-of-file" error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: parser_numbered_paramnobu2019-03-181-9/+17
| | | | | | | * parse.y (parser_numbered_param): hoisted out the contextual check for numbered parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Numbered parameters [Feature #4475]nobu2019-03-171-6/+115
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dsym should be treated as string [ruby-core:91852] [Bug #15670]ktsj2019-03-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Show the source line at an invalid class/instance variablenobu2019-03-151-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: no punctuation instance/class variablesnobu2019-03-141-2/+3
| | | | | | | | * parse.y (parse_atmark): exclude punctuation follows @ marks, whereas it is inclusive after $ mark as some punctuation global variables exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: show invalid global variable linenobu2019-03-141-0/+4
| | | | | | | | * parse.y (parse_gvar): show the source line erred by invalid global variable, and indicate the variable including the wrong punctuation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Hoisted out ruby_show_error_linenobu2019-03-141-54/+86
| | | | | | | | | * parse.y (ruby_show_error_line): hoisted out from parser_yyerror. * parse.y (regx_options): revert r67226 and show the error line separately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* More initializations of YYLTYPEnobu2019-03-141-10/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unnecessary local variablenobu2019-03-131-5/+4
| | | | | | newline is always "\n" when it is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Show unkwon regexp option linenobu2019-03-121-2/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Flush erred tokennobu2019-03-121-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: moved excessed_commanobu2019-03-111-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: trim newline in erred codenobu2019-01-261-0/+1
| | | | | | | | * parse.y (parser_yyerror): trim a newline at the end of the erred code which was replaced with an extra space in the succeeding cursor line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: function parser_mixed_error & parser_mixed_escapenobu2019-01-241-18/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove an extra error messagenobu2019-01-241-0/+6
| | | | | | | | | | | | * parse.y (parse_string): bail out when word-list meets end of input not to show an extra "unexpected" error message after the preceding error. $ ruby -e "%w[" -e:1: unterminated string meets end of file -e:1: syntax error, unexpected terminator, expecting ' ' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: token name of tSTRING_DENDnobu2019-01-231-1/+8
| | | | | | | | | | * parse.y (rb_yytnamerr): show single-quoted single char as-is, to show a quoted closing brace as tSTRING_DEND. e.g.: $ ./ruby -e '"#{true' -e:1: syntax error, unexpected end-of-input, expecting '}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: token namesnobu2019-01-231-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: literal add_mark_objectnobu2019-01-221-9/+6
| | | | | | | * parse.y (set_yylval_str, set_yylval_literal): always imply add_mark_object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper.y: get rid of compile errornobu2019-01-221-3/+2
| | | | | | | yystpcpy is always used by yysyntax_error in bison 2.3, but may not used by other than yytnamerr in newer bison. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: enclose keyword token names by quotesnobu2019-01-221-49/+127
| | | | | | | | * parse.y (rb_yytnamerr): strip enclosing double-quotes, same as the default yytnamerr except for that single-quotes matching back-quotes do not stop stripping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: more token namesnobu2019-01-211-4/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refactored symbol rulesnobu2019-01-051-18/+11
| | | | | | | | | | * parse.y (symbol): turned into a node, as well as `numeric`, for a symbol literal, and includes `dsym` now. * parse.y (ssym): previous `symbol`. renamed as the counterpart of `dsym`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e