Commit graph

14 commits

Author SHA1 Message Date
Kevin Newton
439f069b4b [ruby/yarp] Move tests from test/* to test/yarp/* to match CRuby
This should make it easier on the sync to determine what changed
and hopefully result in fewer merge conflicts that have to be
manually resolved.

17d82afbfc
2023-08-25 21:15:49 +00:00
Kevin Newton
a31b069a8a [ruby/yarp] Track block opening and closing locations
7984e4ddc7
2023-08-25 21:10:13 +00:00
Kevin Newton
61c5c2f1c8 [ruby/yarp] Add names to classes and modules
This should hopefully make it easier to compile these nodes, and
also for static analysis tools for having a quick label.

f086662144
2023-08-25 17:02:38 +00:00
Mike Dalessio
b8cab92a3f [ruby/yarp] fix: unterminated regular expression with a heredoc
Previously this snippet would track the same newline twice, leading to
a failed assertion in yp_newline_list_append.

1d3fe19a94
2023-08-25 12:39:13 +00:00
Mike Dalessio
20927a89c2 [ruby/yarp] Improve handling of line endings
Introduce three new inline helper functions:

- `match_line_ending`
- `match_line_ending_at`
- `match_line_ending_addr`

These functions are similar in signature to the `peek*` functions, but
return the length of the line ending being inspected (or 0 if no line
ending was found).

These functions are then used to simplify how we're detecting line
endings throughout "src/yarp.c".

Also:
- test coverage backfilled for `__END__` comments with CRLF line endings.
- error message for invalid `%` tokens updated to not include
  the potential line endings.
- some small refactorings for readability along the way

a00067386d
2023-08-24 13:45:29 +00:00
Mike Dalessio
461f8eaba7 [ruby/yarp] fix: parsing a '%' expression with a CR but not a newline
Previously this failed an assertion and aborted.

a037d942a8
2023-08-21 19:00:52 +00:00
Mike Dalessio
2800d1fd37 [ruby/yarp] fix: unterminated % in arguments
efb3102369
2023-08-18 12:51:14 +00:00
Takashi Kokubun
3873b1eb39 Resync YARP 2023-08-16 17:47:32 -07:00
Benoit Daloze
3536cad902 [ruby/yarp] Fixes so bundle exec rake can run on JRuby and TruffleRuby
e6cea4fa08
2023-08-16 17:47:32 -07:00
HParker
a8c70ed2b4 [ruby/yarp] add a diagnostic for *rest in order after optional state
908244ba12
2023-08-16 17:47:32 -07:00
Haldun Bayhantopcu
499eb3990f [ruby/yarp] Fix tests
50e745767e
2023-07-26 14:46:20 +00:00
Haldun Bayhantopcu
c680ae2ce1 [ruby/yarp] Added locations to errors tests
108d1221ef
2023-07-26 14:46:19 +00:00
Jemma Issroff
a02f5eb56a
YARP resync (#8059) 2023-07-12 12:46:38 -04:00
Jemma Issroff
cc7f765f2c [Feature #19741] Sync all files in yarp
This commit is the initial sync of all files from ruby/yarp
into ruby/ruby. Notably, it does the following:

* Sync all ruby/yarp/lib/ files to ruby/ruby/lib/yarp
* Sync all ruby/yarp/src/ files to ruby/ruby/yarp/
* Sync all ruby/yarp/test/ files to ruby/ruby/test/yarp
2023-06-21 11:25:39 -07:00