summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2018-03-29Use only CMDARG/COND _PUSH/POP for cmdarg/cond management.nobu
From: Ilya Bylich <ibylich@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-29parse.y: remove `p->` from bitstack tracesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-23parse.y: k_else in bodystmtnobu
* parse.y (bodystmt): expand opt_else to show the error message at the right place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-23parse.y: else without rescuenobu
* parse.y (bodystmt): [EXPERIMENTAL] make `else` without `rescue` a syntax error. [DevelopersMeeting20180315Japan] https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20180315Japan https://docs.google.com/document/d/1RT0ijSo8uJ4Awn3CEvuYkjH0TVeXSYgeAFNmVGYC3ak/edit# > * do-else-end > https://twitter.com/joker1007/status/974173396006129664 > https://twitter.com/joker1007/status/974173641347756032 > https://twitter.com/joker1007/status/974176512554369027 > Will be SyntaxError in 2.6-preview2 > All of begin/do/def (experimental) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22parse.y: reorder in the placenobu
* parse.y (new_args_tail): reorder required and optional keyword argument variable IDs in the place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21parse.y: terminator at continued linenobu
* parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21parse.y: unindent continued linenobu
* parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20node.c: predicates for special NODEsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: NUL-terminate ruby_sourcefilenobu
* parse.y (yycompile): in some cases (warning, error, dtrace,...), ruby_sourcefile is expected to be NUL-terminated, so ensure it. * template/prelude.c.tmpl (prelude_name): NUL-terminate to get rid of copying static data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: push `do` token infonobu
* parse.y (k_rescue, k_ensure): revert r62838. * parse.y (k_do, k_do_LAMBDA, k_do_block): push token infos of `do`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: ignore do indentationsnobu
* parse.y (k_rescue, k_ensure): ignore indentations of `do`, it is not at the beginning of line usually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: mismatched indentations at middlenobu
* parse.y (k_rescue, k_ensure, k_when, k_else, k_elsif): warn mismatched indentations at keywords in middle of blocks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: fix duplicate kwrestnobu
* parse.y (f_kwrest): add the variable name as an argument, as well as an internal variable. * parse.y (new_args_tail): now keyword rest argument variable is always placed between keyword arguments and block argument, so so just reorder required and optional keyword arguments. no longer kwrest duplicates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-12ripper: fix escaped spacenobu
* parse.y: use tSP same as ripper instead of tSPACE. [ruby-core:86080] [Bug #14597] * ext/ripper/eventids2.c: tSP is defined in ripper.c now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-11parse.y: fix interpolated string literal dedentnobu
* parse.y (heredoc_dedent): fix interpolated string literal dedent, remove indentations from only nodes with the newline flag. [ruby-core:85983] [Bug #14584] * parse.y (here_document): set the newline flag on literal string nodes starting at the beginning of line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-11parse.y: reduce duplicate codenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-06parse.y: tSPACE for old bisonnobu
* parse.y (tSPACE): define a separate token for escaped space, to fix `redefining user token number of ' '` error at word list separator on bison 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-05parse.y: named whitespacesnobu
* parse.y: named escaped whitespaces to show unexpected character. bare whitespaces should not appear outside of word_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-01parse.y: refine assign_in_cond warningnobu
* parse.y (assign_in_cond): refine a warning message for assignment of a literal in conditinal expression. [ruby-core:85872] [Bug #14562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-23[DOC] missing docs at toplevelnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22Fix CMDARG manipulationnobu
* parse.y: Fix CMDARG manipulation. Use CMDARG_P to identify keyword_do/keyword_do_block. [Feature #14506] [Fix GH-1823] From: Ilya Bylich <ibylich@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-03parse.y: named backslashnobu
* parse.y: named backslash to show unexpected character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-03parse.y: use lex_goto_eol to skip to EOLnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28parse.y (parser_append_options): shorter alias LOCnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23parse.y: fix yytokentype function declarationsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23parse.y: added implicit parser_params argumentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23parse.y: added new_strterm wrappernobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23parse.y: concat dedented heredocnobu
* parse.y (heredoc_dedent): concat literal strings after dedented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23parse.y: removed implicit parser_params macrosnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: expand tokp macronobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: add EXPR_NONEnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: fix state after left bracenobu
* parse.y (parser_yylex): as well as `tLBRACE_ARG` (expr block), `tLBRACE` (primary block) also does not accept a label. only hash brace accepts a label. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: revert trace message to lex_statenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: use enum yytokentypenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-21parse.y: parser_token_value_print for yydebugnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove unneeded macro nd_set_linemame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove double meaning of new_qcall/new_command_qcallmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: rewrite excessed_comma processmame
Currently, parser.y includes core parser and Ripper parser obscurity. In addition, *some* Ripper code uses the result of the core parser, which make it difficult to separate the two parsers. I want to simplify this, not by separating the two parsers, but by making *all* Ripper actions follows the core parser actions. In other words, all the core parser actions run always even in Ripper, and after that, Ripper-specific actions run. For tha sake, in principle, I want to put `/*% ripper: ... %*/` in the end of actions. Anyway, it is too dirty to put it within expressions, IMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove macros that are no longer usedmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove double meaning of new_op_assign, etc.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove double meaning of new_xstring/new_string1mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: remove double meaning of new_brace_body/new_do_bodymame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: remove double meaning of const_path_field/top_const_fieldmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: Remove unneeded var_field_1 trickmame
I thought this trick was needed because the result of var_field was passed to different arguments, as follows: ``` $1 = var_field(p, $1); $$ = backref_assign_error(p, $1, $1, &@$); ``` Currently the DSL supports that one result is passed to one argument. However, after the refactoring, I found that `backref_assign_error` uses only one `$1`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: dot_or_colon as idnobu
* parse.y (dot_or_colon): made type of `dot_or_colon` and EXPR_DOT tokens to <id> and set those IDs at tokenization. type cast at primary in ripper is no longer needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y: moved excessed_commanobu
* parse.y (block_param): embed excessed_comma event result in place of rest argument, instead of dispatching with the whole parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20dsl.rb: pnobu
* ext/ripper/tools/dsl.rb (DSL#initialize): define `p` for `struct parser_params *p`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20dsl.rb: ID constantsnobu
* ext/ripper/tools/dsl.rb (DSL#method_missing): expand ID constnats without parentheses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20dsl.rb: const_missingnobu
* ext/ripper/tools/dsl.rb (DSL.const_missing): define to expand Qnil and Qundef as-is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20parse.y (yycompile0): check if acceptednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e