212 Commits
Author SHA1 Message Date
NARUSE, Yui a6dec2e144 merge revision(s) 5de38c41ae: [Backport #17644]
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug
	 #17644]

	---
	 ext/ripper/lib/ripper/lexer.rb |  2 +-
	 test/ripper/test_lexer.rb      | 12 ++++++++++++
	 2 files changed, 13 insertions(+), 1 deletion(-)
2021-03-02 18:28:30 +09:00
NARUSE, Yui 17986daf6e merge revision(s) b84b253a69: [Backport #17547]
Fix Ripper with heredoc.

	---
	 ext/ripper/lib/ripper/lexer.rb |  1 +
	 test/ripper/test_lexer.rb      | 10 ++++++++++
	 2 files changed, 11 insertions(+)
2021-02-01 23:07:02 +09:00
Nobuyoshi Nakada 733ed1e184 ripper: fix bad label parameter handling [Bug #17425] 2020-12-23 09:56:35 +09:00
Nobuhiro IMAI e33eb09b76 ripper: fix #tok on some error events [Bug 17345]
sorting alias target by event arity, and setup suitable `Elem` for error.
2020-12-19 17:32:39 +09:00
Nobuyoshi Nakada 47328ad217 Ripper: Fixed erred token on wrong alias [Bug #17345] 2020-12-16 21:08:33 +09:00
Nobuyoshi Nakada e0bdd54348 Ripper: Refined error callbacks [Bug #17345] 2020-12-15 21:36:23 +09:00
Nobuyoshi Nakada f5ca3ff4db Store all kinds of syntax errors [Bug #17345] 2020-11-26 20:14:34 +09:00
Nobuyoshi Nakada 1df3896382 Removed a duplicate assertion 2020-11-26 20:03:38 +09:00
Nobuhiro IMAI 1800f3fa5c Ripper.{lex,tokenize} return full tokens even if syntax error
yet another implements [Feature #17276]
2020-11-20 11:44:57 +09:00
Jeremy Evans cd0877a93e Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}
Implements [Feature #17276]
2020-11-17 21:15:50 -08:00
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 NakadaandJeremy Evans 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