aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* keywords: shrink struct kwtablenobu2018-01-213-3/+3
| | | | | | | | * defs/keywords (struct kwtable): shrink since members do not exceed 16bit. lex_state needs to be int (or enum lex_state_e) when EXPR_MAX_STATE reaches it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix state after left bracenobu2018-01-211-1/+1
| | | | | | | | * 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
* parse.y: revert trace message to lex_statenobu2018-01-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use enum yytokentypenobu2018-01-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: parser_token_value_print for yydebugnobu2018-01-211-0/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix missing m4_include at r61982kazu2018-01-211-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c: use rb_warning directlynormal2018-01-201-3/+1
| | | | | | | | | | This removes the last dependency on rb_mWarning outside of error.c and allows future commits to mark it static. Yes, I expect this to slow down the emitting of a warning message in a cold code path slightly :P git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/ripper/tools/dsl.rb: Use String#sub instead of delete_suffixmame2018-01-201-1/+1
| | | | | | It fails when baseruby is old. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unneeded macro nd_set_linemame2018-01-201-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove double meaning of new_qcall/new_command_qcallmame2018-01-202-36/+63
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/ripper/tools/dsl.rb: Serialize dispatch callsmame2018-01-201-4/+22
| | | | | | | | | | To avoid the unspecified behavior (the evaluation order of arguments). In `$$ = foo(bar(), baz());`, it is unspecified which `bar` or `baz` is called earlier. This commit changes the code to `v1=bar(); v2=baz(); $$ = foo();`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rewrite excessed_comma processmame2018-01-201-8/+4
| | | | | | | | | | | | | | | | | 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
* parse.y: Remove macros that are no longer usedmame2018-01-201-7/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove double meaning of new_op_assign, etc.mame2018-01-201-20/+31
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove double meaning of new_xstring/new_string1mame2018-01-201-11/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove double meaning of new_brace_body/new_do_bodymame2018-01-201-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-01-21svn2018-01-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove double meaning of const_path_field/top_const_fieldmame2018-01-201-16/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Emacs friendliness [ci skip]shyouhei2018-01-2034-0/+34
| | | | | | | Just add comment by: sed -i $'1i\\\n# -*- Autoconf -*-' tool/m4/*.m4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* set AC_CONFIG_MACRO_DIRS [close GH-1793]shyouhei2018-01-203-52/+33
| | | | | | | | We do not use aclocal(1) by default. But in case users do so, AC_CONFIG_MACRO_DIRS help them reconstruct the same contents as this commit includes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refactor split configure.ac into filesshyouhei2018-01-2036-769/+794
| | | | | | | | This does not (yet) change anything. The generated configure file is the identical to previous one (except several empty lines added and deleted). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.sub: missing/nan.objnobu2018-01-201-1/+1
| | | | | | * win32/Makefile.sub (MISSING): nan() is available since msvcrr120. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unneeded var_field_1 trickmame2018-01-202-12/+10
| | | | | | | | | | | | | | | | | 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
* parse.y: dot_or_colon as idnobu2018-01-201-13/+8
| | | | | | | | * 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
* parse.y: moved excessed_commanobu2018-01-201-2/+10
| | | | | | | | * 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
* dsl.rb: pnobu2018-01-202-17/+20
| | | | | | | * 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
* dsl.rb: ID constantsnobu2018-01-202-2/+4
| | | | | | | * 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
* dsl.rb: const_missingnobu2018-01-202-15/+19
| | | | | | | * 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
* dsl.rb: indentnobu2018-01-201-2/+2
| | | | | | | * ext/ripper/tools/dsl.rb (DSL#generate): indent after surrounding by braces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [ci skip] tabifyshyouhei2018-01-201-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add missing/nan.cshyouhei2018-01-205-22/+31
| | | | | | | | | instead of scattering #ifdef HAVE_NANF here and there define our own nan() unless defined elsewhere. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (yycompile0): check if acceptednobu2018-01-201-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* r61950 changes mode_t to ushort on FreeBSD and Darwinnaruse2018-01-192-14/+64
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (assignable): Remove macro hellmame2018-01-191-62/+60
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Split the path of assignable to Ripper/Parsermame2018-01-191-48/+52
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove double meaning of node_assignmame2018-01-191-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove double meaning of backref_assign_errormame2018-01-192-10/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove unneeded type decls for Rippermame2018-01-193-18/+3
| | | | | | 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-20svn2018-01-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: swap `foo!` and `foo` in Ripper DSLmame2018-01-192-215/+216
| | | | | | | | `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
* test_io.rb: avoid OOMnobu2018-01-191-1/+2
| | | | | | | * test/ruby/test_io.rb (TestIO#test_copy_stream_socket7): reduce memory usage so the worker process will not die by OOM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: assign to $$nobu2018-01-191-0/+1
| | | | | | | * 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
* parse.y: fix up r61957, toomame2018-01-191-8/+8
| | | | | | My apologies! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix up r61957nobu2018-01-191-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Allows Ripper DSL to embed C function calls as `foo!`mame2018-01-192-40/+40
| | | | | | | 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
* Fix warningkazu2018-01-191-1/+1
| | | | | | ``lib/net/protocol.rb:214: warning: `*' interpreted as argument prefix`` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Remove new_commandmame2018-01-191-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/ripper/tools/preproc.rb: Remove `/*%c%` handlingmame2018-01-191-4/+0
| | | | | | It was replaced with `/*% ripper[brace]: ... %*/` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-01-190-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/ripper: Introduce a simple DSL for ripper.y code generationmame2018-01-195-740/+501
| | | | | | | | | | | | | | | | | | | 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