Commit graph

13 commits

Author SHA1 Message Date
Aaron Patterson
abce8583e2 [ruby/yarp] Fix heredocs inside %W and %w lists
The problem was that we were treating heredoc bodies as part of the %W
list because we didn't push the scanning cursor past the heredoc after
lexing out the here doc.  To fix this, we changed the whitespace
scanning function to quit scanning when it reaches a newline but only in
the case that a heredoc is present.

Additionally, we need to prevent double counting newlines in the case of
a heredoc.  For example:

```ruby
%W(<<foo 123)
foo
```

The newline after the `)` is counted as part of scanning the heredoc, so
we added logic to prevent double counting the newline when scanning the
rest of the %W list.

eb090d8126

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2023-07-20 14:58:11 +00:00
Jemma Issroff
84b5274143
[ruby/yarp] Resync YARP (#8098) 2023-07-19 16:15:01 -04:00
Jemma Issroff
a02f5eb56a
YARP resync (#8059) 2023-07-12 12:46:38 -04:00
Jemma Issroff
d62328251d [ruby/yarp] Remove yp_location_for_node in preference of yp_newline_list_line_column
55aa813909
2023-07-11 15:49:42 +00:00
Jemma Issroff
53c5601565
[ruby/yarp] Fix endless method definitions binding power to accept args (#8051) 2023-07-10 10:54:12 -04:00
Jemma Issroff
9e3a5cc54f [ruby/yarp] Add a yp_location_for_node function to the C API
yp_location_for_node takes a parser and a node and returns the
location in a way that can be punned into ruby/ruby types

75e06016a7
2023-07-07 17:46:47 +00:00
Jemma Issroff
06c2d3e0a0
Resync YARP (#8036)
It got out of sync again. After this re-sync, it should happen
cherry-picking automatically.
2023-07-06 13:26:26 -04:00
Jemma Issroff
bfb933371d Manual YARP resync 2023-07-05 16:58:55 -04:00
Takashi Kokubun
711cabec26 Sync ruby/yarp to 89a00203af 2023-06-22 09:23:07 -07:00
Jemma Issroff
e8fb84265c [ruby/yarp] Allow for block statements after elsif and else
4560cab235
2023-06-22 09:20:40 -07:00
Kevin Newton
b879528e24 [ruby/yarp] Do not leak memory from lex modes
df6661740c
2023-06-22 09:19:36 -07:00
Jemma Issroff
b0a3a6ade0 [ruby/yarp] Fix invalid unescape sequence error for lower w
5a2c78367a
2023-06-21 18:40:25 +00: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