summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
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
2018-01-19parse.y (assignable): Remove macro hellmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Split the path of assignable to Ripper/Parsermame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Remove double meaning of node_assignmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Remove double meaning of backref_assign_errormame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Remove unneeded type decls for Rippermame
I think that they are not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: swap `foo!` and `foo` in Ripper DSLmame
`foo!(...)` means Ripper event, and `foo(...)` means C function/macro call. This is for fail-safe; if I forget `!` accidentally, it would fail to compile, instead of wrongly adding a new Ripper event. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: assign to $$nobu
* parse.y (command): assign to $$. should not rely upon undocumented behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: fix up r61957, toomame
My apologies! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: fix up r61957nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Allows Ripper DSL to embed C function calls as `foo!`mame
Instead of `_foo`. This makes it useful to do word boundary search of the editor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Remove new_commandmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19ext/ripper: Introduce a simple DSL for ripper.y code generationmame
Currently, parse.y actions are hard to read and write because the code has double meaning (for core parser and for ripper). I think that, if it is easy to write ripper's code shortly and simply, the double meaning trick is not needed. For the sake, this change adds a simple DSL for ripper's code. For example, in parse.y, we can write: /*% ripper: stmts_add(stmts_new, void_stmt) %*/ instead of: $$ = dispatch2(stmts_add, dispatch0(stmts_new), dispatch0(void_stmt)); git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19parse.y: Fix excessed_comma eventmame
I believe that the assignment to `$$` was just forgotten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18rb_parser_lex_state_names marked as staticshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18parse.y: no longer undef assignablenobu
* parse.y (assignable): no longer needs to undef since r61899. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18parse.y: fix overflownobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18parse.y: REQUIRED_KEYWORDnobu
* parse.y (REQUIRED_KEYWORD): special argument for required keyword argument, for core and ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-17parse.y: refine negate_lit_gen error messagenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16parse.y: Refactor for-statement generationmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16parse.y (new_args_tail): Use human-friendly variable namesmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16parse.y: unified local_push argumentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16parse.y: simplified compstmtnobu
* parse.y (top_compstmt, compstmt): unified void_stmts with ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGNmame
NODE_FOR was used both for "for"-statement itself and for multi-assignment of for-statement (for x, y, in...end). This change separates the two purposes, NODE_FOR for the former, and newly introduced NODE_FOR_MASGN for the latter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e