198 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
3d8705dcfd
Drop token info for endless method definition
Because it does not have closing `end`.
2020-06-25 01:14:26 +09:00
Nobuyoshi Nakada
419b0596a2
[ripper] added endless method definition event tests 2020-06-25 01:14:18 +09:00
Nobuyoshi Nakada
263b941321
[ripper] fix mismatched indentations warning [Bug #16981]
The scanner location has to be set from `lex.ptok` before it is
flushed by dispatching the scanner event.
2020-06-24 19:53:14 +09:00
Nobuyoshi Nakada
7f29e34f35
[ripper] fail unless got warning as expected 2020-06-24 19:52:39 +09:00
Kazuki Tsujimoto
ddded1157a
Introduce find pattern [Feature #16828] 2020-06-14 09:24:36 +09:00
Jeremy Evans
f8b4340fa2 Add leading arguments support to arguments forwarding
The idFWD_KWREST sections may be wrong. However, the existing
idFWD_KWREST sections for ... without leading arguments are already
broken.

Implements [Feature #16378]
2020-06-06 17:07:11 -07:00
Nobuyoshi Nakada
1c7f5a5712
Removed unnecessary RLIMIT_AS
Even without this limit, these assertions almost certainly cause a
NoMemoryError by removing the fix in 72ad8595f20.
2020-04-28 23:36:16 +09:00
Nobuyoshi Nakada
27ddb6e998
Warn also numbered parameter like parameters
[Feature #16433]
2019-12-20 01:25:34 +09:00
Nobuyoshi Nakada
9e01fcd0cb
[ripper] Fixed unique key check in pattern matching
Check keys
* by an internal table, instead of unstable dispatched results
* and by parsed key values, instead of escaped forms in the source
2019-11-26 22:54:35 +09:00
Nobuyoshi Nakada
26625bc33c
[ripper] Quoted label without expression must be a local variable
The difference from 0b8c73aa65add5c57b46b0cfdf4e661508802172 is to
add the result of `string_add` event to marking objects.

```C
			    RNODE($1)->nd_rval = add_mark_object(p, $$);
```
2019-11-25 17:42:59 +09:00
Nobuyoshi Nakada
61131edba7
Revert "[ripper] Quoted label without expression must be a local variable"
This reverts commit 0b8c73aa65add5c57b46b0cfdf4e661508802172, which
seems breaking RVALUE consistency check.
2019-11-20 00:56:04 +09:00
Nobuyoshi Nakada
0b8c73aa65
[ripper] Quoted label without expression must be a local variable 2019-11-19 17:18:27 +09:00
Nobuyoshi Nakada
4d615a0c8f
#@1 is no longer an embedded variable 2019-11-14 16:37:25 +09:00
Nobuyoshi Nakada
fb6a489af2
Revert "Method reference operator"
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b.
[Feature #16275]
2019-11-12 17:24:48 +09:00
Nobuyoshi Nakada
62d4382877 Arguments forwarding [Feature #16253] 2019-10-22 02:35:43 +09:00
Nobuyoshi Nakada
33c5ad3154
Removed idNUMPARAM_0 2019-09-25 13:52:53 +09:00
Nobuyoshi Nakada
ea68bb914a Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
Nobuyoshi Nakada
7e0f56fb3d
Name dynamically defined methods with line numbers 2019-09-13 19:48:44 +09:00
Jeremy Evans
4d64693c70 Make ripper support **nil syntax
The on_params hook will use :nil as the keyword rest argument.
There is a new on_nokw_param hook as well.

This fixes a type issue in the previous code, where an ID was
passed where a VALUE was the declared type.  The symbol :nil is
passed instead of the id.
2019-08-30 12:39:31 -07:00
Nobuyoshi Nakada
2ed68d0ff9
Revert "Add pipeline operator [Feature #15799]"
This reverts commits:
* d365fd5a024254d7c105a62a015a7ea29ccf3e5d
* d780c3662484d6072b3a6945b840049de72c2096
* aa7211836b769231a2a8ef6b6ec2fd0ec882ef29
* 043f010c28e82ea38978bf8ed885416f133b5b75
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28e82ea38978bf8ed885416f133b5b75
* f169043d81524b5b529f2c1e9c35437ba5bc3a7a

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
2019-08-29 15:27:59 +09:00
Koichi Sasada
a9fd57056c double memory limit on MJIT.
On test with MJIT, sometimes it fails like:
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2189967
2019-08-09 13:04:56 +09:00
Nobuyoshi Nakada
d2710ba866
Split test/ripper/test_files.rb to run in parallel 2019-07-23 05:21:41 +09:00
Nobuyoshi Nakada
9d8855b682
Added assertions for Unicode escaped CHAR scanner events 2019-07-06 18:46:00 +09:00
Nobuyoshi Nakada
f19e048d24
Do not dispatch a nil token in ripper
As a comment token includes the newline, so delayed newline token
just follows it should not be dispatched.  [Bug #11485]

Co-Authored-By: Jeremy Evans <code@jeremyevans.net>
2019-07-04 15:58:47 +09:00
Nobuyoshi Nakada
8ec877d183
Add parentheses to suppress a warning 2019-06-28 17:10:18 +09:00
Nobuyoshi Nakada
3dba16a5d6
Test string content 2019-06-28 17:08:47 +09:00
Nobuyoshi Nakada
5331932cd2
Removed unused variables 2019-06-28 17:08:21 +09:00
Nobuyoshi Nakada
8d04f90da4
Fixed a variable name 2019-06-28 17:07:17 +09:00
Nobuyoshi Nakada
097554855c
Fix ripper fatal
* parse.y (parser_yylex): return END_OF_INPUT at unterminated here
  document instead of an error.  [Bug #15962]
2019-06-27 15:32:03 +09:00
Nobuyoshi Nakada
2a56702eee
Test for unterminated here-docs 2019-06-27 15:13:45 +09:00
Nobuyoshi Nakada
f169043d81
Add pipeline operator [Feature #15799] 2019-06-13 18:44:32 +09:00
Nobuyoshi Nakada
c990b3c41a
Fix the error token on "invalid hex escape"
* parse.y (tok_hex): flush token after dispatching the "invalid
  hex escape" parse error.
2019-06-03 15:15:54 +09:00
Nobuyoshi Nakada
92ecf58b1e
parse.y: adjust here-doc error token
* parse.y (here_document): adjust token to the here-doc identifier
  in compile_error when a here-document misses the closing
  identifier.
2019-05-30 22:03:33 +09:00
Nobuyoshi Nakada
b0e2b7a5ff
Include stack elements left after errors 2019-05-30 21:54:38 +09:00
Nobuyoshi Nakada
1da5c73932
parse.y: fix state after ivar/cvar
* parse.y (parse_atmark): return EXPR_END or EXPR_ENDFN, depending
  on the previous state, even incomplete names consistently.
2019-05-29 21:42:58 +09:00
Nobuyoshi Nakada
cc66272e50
parse.y: flush invalid char 2019-05-29 13:24:24 +09:00
Nobuyoshi Nakada
b4365e75fd
Do not make an incomplete escape a valid char 2019-05-27 23:08:48 +09:00
Nobuyoshi Nakada
c40003da25
Ripper#token
* parse.y (ripper_token): added Ripper#token which returns the
  current token string.  [EXPERIMENTAL]
2019-05-27 23:08:45 +09:00
Nobuyoshi Nakada
02b39daef8
Fix scanner event at invalid syntax
* parse.y (parser_yyerror, parser_compile_error): revert
  r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred
  token".
2019-05-26 16:24:33 +09:00
NARUSE, Yui
f1486fea46 require 'stringio' 2019-05-09 09:23:44 +09:00
ktsj
9738f96fcf Introduce pattern matching [EXPERIMENTAL]
[ruby-core:87945] [Feature #14912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 06:48:03 +00:00
nobu
afa1505ca8 parse.y: removed redundant number_arg parser event
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19 06:23:36 +00:00
nobu
fa66569afa parse.y: fix var_ref of numbered param in ripper
* 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-19 06:01:21 +00:00
nobu
e39f7e64b7 parse.y: fix segv with Ripper#yydebug
* 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-19 02:35:50 +00:00
nobu
12acc751e3 Numbered parameters [Feature #4475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:21:18 +00:00
ktsj
7006fdecf2 dsym should be treated as string [ruby-core:91852] [Bug #15670]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 04:00:14 +00:00
nobu
9800fc26b0 parse.y: no punctuation instance/class variables
* 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-14 08:13:46 +00:00
nobu
72df0a8e47 Add ignored_sp event
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): add ignored_sp
  event which will be fired from Ripper::Lexer#on_heredoc_dedent
  method.  [ruby-core:91727] [Bug #15648]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 10:17:33 +00:00
nobu
8776a09d4e Use assert_respond_to
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 10:14:16 +00:00
nobu
67c5747369 Method reference operator
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-31 15:00:37 +00:00