summaryrefslogtreecommitdiff
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* rb_parser_lex_state_names marked as staticshyouhei2018-01-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: no longer undef assignablenobu2018-01-181-1/+0
| | | | | | * 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
* parse.y: fix overflownobu2018-01-181-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: REQUIRED_KEYWORDnobu2018-01-181-3/+4
| | | | | | | * 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
* parse.y: refine negate_lit_gen error messagenobu2018-01-171-12/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Refactor for-statement generationmame2018-01-161-18/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_args_tail): Use human-friendly variable namesmame2018-01-161-22/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unified local_push argumentnobu2018-01-161-5/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: simplified compstmtnobu2018-01-161-17/+11
| | | | | | | * 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
* node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGNmame2018-01-161-2/+2
| | | | | | | | | 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
* parse.y (expr_value_do): factor out COND_PUSH->expr_value->do->COND_POPmame2018-01-161-16/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: removed PARSER_ARG macronobu2018-01-161-38/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: expand tokadd_mbcharnobu2018-01-161-11/+9
| | | | | | * parse.y (tokadd_mbchar): renamed and expand callers with p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set location of nodes that lexer generatesmame2018-01-161-24/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set location of string/literals in the lexer instead of actionsmame2018-01-161-40/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_regexp): Fix SEGV of `/#{"\u3042"}#{'い'}/` in non UTF-8mame2018-01-161-2/+1
| | | | | | | 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/trunk@61862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (symbol_append): Added to factor out `%i[]` and `%I[]`mame2018-01-161-14/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Removes unneeded Ripper/Parser guardsmame2018-01-151-25/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_command_qcall): Receives a block (optional)mame2018-01-151-32/+27
| | | | | | | There were four cases that uses new_command_qcall and then method_add_block. This change factors out the four rules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Removes unreachable warningsmame2018-01-151-29/+14
| | | | | | tIDENTIFIER is now always a local id (except fname). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Removes unneeded NULL checksmame2018-01-151-11/+1
| | | | | | Nowadays, there are less rules whose return value is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unneeded NULL checkmame2018-01-151-7/+2
| | | | | | There are many usages assuming that bodystmt always returns non-null. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (last_arg_append, rest_arg_append): factor out the code clonesmame2018-01-151-46/+41
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_ary_op_assign): Factor out the typical code clonemame2018-01-151-32/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Fix a bug of `obj[42, &blk] ||= foo bar`mame2018-01-151-1/+6
| | | | | | Follow up of r28123 (!) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (begin_block): Factor out BEGIN {} process.mame2018-01-151-13/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unused code comment blocksmame2018-01-151-18/+3
| | | | | | | The code fragments were commented out in YARV merge era. I believe that it will be never needed in near future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_heredoc_dedent): Removedmame2018-01-141-8/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: yydebugnobu2018-01-141-10/+12
| | | | | | | * parse.y (yydebug): define to disable a global variable and get rid of linker error when static linked ext. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unused a macro "FIXME"mame2018-01-141-2/+0
| | | | | | | I don't know what it was, but seems that it has been already fixed since r12117. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: ripper no longer uses rb_discard_nodenobu2018-01-141-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove a code for old yaccmame2018-01-141-9/+0
| | | | | | | | The current parse.y won't compile with yacc since it depends on many bison's extensions. Also, configure.ac does not have a check for yacc, so the macro OLD_YACC is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove almost all *_gen macros by passing parser_params explicitlymame2018-01-141-717/+635
| | | | | | | | | | | | | In parse.y many functions were suffixed "_gen" and had companion macros to pass struct parser_params implicitly, which made parse.c bigger and more obscure. This change expands and removes almost all "*_gen" macros. This requires explicit passing of struct parser_params, i.e., we need to write "foo(p, ..)" instead of "foo(..)". However, it is just extra three letters. I believe that this is easier to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Expand global-like accessor macros for struct parser_paramsmame2018-01-141-565/+525
| | | | | | | | For example, `lex_strterm` is expanded to `p->lex.strterm`. I believe that this expansion make the code straightforward. They look not so annoying because "parser" was renamed to "p". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Use "p" for the variable of struct parser_params consistentlymame2018-01-141-773/+773
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Avoid "p" as a variable namemame2018-01-141-104/+104
| | | | | | | | Because I want to use the name "p" for struct parser_params through parse.c. This change renames "p" to "ptr", "paren", etc. depending upon the context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove meaningless ifndef guardsmame2018-01-121-5/+0
| | | | | | Because the part of the code is already within `#ifndef RIPPER`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (token_info_push, token_info_pop): Refactoringmame2018-01-121-41/+33
| | | | | | | | * remove unused argument len * factor out initialization code of token_info * make the condition of "mismatched indentations" warning easy to understand git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (token_info_push, token_info_pop): Use code_locationmame2018-01-121-36/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unneeded dependence on pointer representatinmame2018-01-121-9/+8
| | | | | | A simple comparison is enough in this case git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove LEXPOP hackmame2018-01-111-10/+21
| | | | | | | | | | cmdarg_stack became inconsistent state due to look-ahead, and LEXPOP hack smoothed over the inconsistency. This commit fixes the inconsisitent state itself, and removes LEXPOP hack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]kazu2018-01-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: disentangle the lexer handling of ')', ']', and '}'mame2018-01-111-8/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: simplify and add a comment for paren_nest and lpar_begmame2018-01-111-7/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: add a simple comment for COND_* and CMDARG_*mame2018-01-111-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (local_push_gen): Rewrite the condition of "unused var" warningmame2018-01-111-6/+11
| | | | | | It was unnecessarily too complex, IMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: insane syntax too (class definition in cond)mame2018-01-091-27/+12
| | | | | | | This change partially reverts r61724 and take another approach: exploiting struct local_vars to backup the cond_stack state. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix indent [ci skip]kazu2018-01-091-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: insane syntaxnobu2018-01-091-8/+26
| | | | | | | * parse.y (primary): save/restore COND and CMDARG stacks at method definition, to distinguish do_block and do_cond properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename code_range to code_locationmame2018-01-091-352/+352
| | | | | | | | | | | Because the name "code_range" is ambiguous with encoding's. Abbreviations ("crange", and "cr") are also renamed to "loc". The traditional "code_location" (a pair of lineno and column) is renamed to "code_position". Abbreviations are also renamed (first_loc to beg_pos, and last_loc to end_pos). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e