Граф коммитов

202 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 79b242260b
ripper: Invalid pragma value warning 2020-11-02 22:49:42 +09:00
Nobuyoshi Nakada 52c630da00
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
2020-10-26 18:00:24 +09:00
Takashi Kokubun 4a7dccf44f
Add a Ripper.lex test of :on_embexpr_end
This is a weird use case of Ripper.lex which I'm not sure is supposed to
be maintained, so I'm adding this test so that we can easily notice such
changes.

If we change the behavior, this will break the behavior of hamlit.gem v1
and code like https://github.com/haml/haml/pull/1043.
2020-10-19 20:56:09 -07:00
Nobuyoshi Nakada 4ed0c33d13
Prohibit setter method names in all kinds of endless methods
Also unwrap NODE_RIPPER to check the method name.
2020-10-12 00:40:55 +09:00
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 72ad8595f2.
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 0b8c73aa65 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 0b8c73aa65, 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 67c5747369.
[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:
* d365fd5a02
* d780c36624
* aa7211836b
* 043f010c28
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28
* f169043d81

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 (e5d10cda07) "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