summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2019-04-03Introduce beginless range [Feature#14799]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-28parse.y: show error line separatelynobu
* 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
2019-03-20parse.y: make tNUMPARAM idnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19parse.y: removed redundant number_arg parser eventnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19parse.y: fix var_ref of numbered param in rippernobu
* 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
2019-03-19parse.y: fix segv with Ripper#yydebugnobu
* 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
2019-03-19Added Ripper#debug_outputnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18parse.y: numbered parameter in lambdanobu
* 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
2019-03-18parse.y: continue after invalid namenobu
* 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
2019-03-18parse.y: parser_numbered_paramnobu
* 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
2019-03-17Numbered parameters [Feature #4475]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16dsym should be treated as string [ruby-core:91852] [Bug #15670]ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15Show the source line at an invalid class/instance variablenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-14parse.y: no punctuation instance/class variablesnobu
* 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
2019-03-14parse.y: show invalid global variable linenobu
* 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
2019-03-14Hoisted out ruby_show_error_linenobu
* 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
2019-03-14More initializations of YYLTYPEnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-13Remove unnecessary local variablenobu
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
2019-03-12Show unkwon regexp option linenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-12Flush erred tokennobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11parse.y: moved excessed_commanobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-26parse.y: trim newline in erred codenobu
* 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
2019-01-24parse.y: function parser_mixed_error & parser_mixed_escapenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-24parse.y: remove an extra error messagenobu
* 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
2019-01-23parse.y: token name of tSTRING_DENDnobu
* 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
2019-01-23parse.y: token namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-22parse.y: literal add_mark_objectnobu
* 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
2019-01-22ripper.y: get rid of compile errornobu
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
2019-01-22parse.y: enclose keyword token names by quotesnobu
* 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
2019-01-21parse.y: more token namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05parse.y: refactored symbol rulesnobu
* 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
2019-01-05parse.y: refine error messagesnobu
* parse.y: refine error messages for tSYMBEG and tSTRING_BEG, which can appear at invalid places. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31Method reference operatornobu
Introduce the new operator for method reference, `.:`. [Feature #12125] [Feature #13581] [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20parse.y: ignore constant name capturesnobu
* parse.y (reg_named_capture_assign_iter): ignore non-local name captures, including non-ASCII constant names. [ruby-dev:50719] [Bug #15437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-25Fix locations of NODE_UNDEF in undef with multiple argsyui-knk
* parse.y: Fix the beginning position of trailing NODE_UNDEF. e.g. The location of the NODE_UNDEF for `b` is fixed: ``` undef a, b ``` * Before ``` NODE_UNDEF (line: 1, location: (1,6)-(1,10)) ``` * After ``` NODE_UNDEF (line: 1, location: (1,9)-(1,10)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-25parser: improve error messagesnobu
[Fix GH-2011] From: Akim Demaille <akim.demaille@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-10Constified ruby_sourcefilenobu
which usually refers ruby_sourcefile_string and is not freed directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-10Parse the source in SCRIPT_LINES__ as arraynobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-09Get rid of setting SCRIPT_LINES__ by AST.parsenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-05Implement `RubyVM::AST.of` [Feature #14836]yui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-31parse.y: last node of NODE_ARRAYnobu
* parse.y (heredoc_dedent): manage the last node of NODE_ARRAY, when concatenating dedented literals. [ruby-core:89649] [Bug #15272] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30parse.y: last location from bisonnobu
* parse.y (command): set the last location from the location managed by bison, so that other nodes are not needed. [ruby-core:89648] [Bug #15271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26parse.y: remove "shadowing outer local variable" warningmame
You can now write the following without warning. user = User.all.find {|user| cond(user) } Fixes [Feature #12490]. A patch from Soutaro Matsumoto <matsumoto@soutaro.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26Revert "parse.y: remove "shadowing outer local variable" warning"mame
I forgot to add the copyright of the patch... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26parse.y: remove "shadowing outer local variable" warningmame
You can now write the following without warning. user = User.all.find {|user| cond(user) } Fixes [Feature #12490]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20parse.y: Fix the compile erroryui-knk
* parse.y: Fix "error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20Fix locations of NODE_SCOPE in lambda.yui-knk
* parse.y: Fix to start with the argument. e.g. The locations of the NODE_SCOPE is fixed: ``` -> x { 1 + 2 } ``` * Before ``` NODE_SCOPE (line: 1, location: (1,2)-(1,14)) ``` * After ``` NODE_SCOPE (line: 1, location: (1,3)-(1,14)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20Fix locations of NODE_LAMBDA.yui-knk
* node.h: Add `nd_first_loc` and `nd_set_first_loc` * parse.y: Fix to start with the beginning of `->` . e.g. The locations of the NODE_LAMBDA is fixed: ``` -> x { 1 + 2 } ``` * Before ``` NODE_LAMBDA (line: 1, location: (1,2)-(1,14)) ``` * After ``` NODE_LAMBDA (line: 1, location: (1,0)-(1,14)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20parse.y (struct ripper_args): Remove not used struct definitionyui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-20parse.y: fix block passing with empty kwargsnobu
* parse.y (arg_blk_pass): preceeding arguments node may be NULL when an empty keyword argument hash splat is optimized away. [ruby-core:88890] [Bug #15087] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e