ruby/yarp
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.

https://github.com/ruby/yarp/commit/eb090d8126

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2023-07-20 14:58:11 +00:00
..
enc Manual YARP resync 2023-07-05 16:58:55 -04:00
util [ruby/yarp] Fix heredocs inside %W and %w lists 2023-07-20 14:58:11 +00:00
api_node.c Manual YARP resync 2023-07-05 16:58:55 -04:00
api_pack.c Sync ruby/yarp to 89a00203af 2023-06-22 09:23:07 -07:00
ast.h Manual YARP resync 2023-07-05 16:58:55 -04:00
config.h Manual YARP resync 2023-07-05 16:58:55 -04:00
defines.h [ruby/yarp] Resync YARP (#8098) 2023-07-19 16:15:01 -04:00
diagnostic.c
diagnostic.h Manual YARP resync 2023-07-05 16:58:55 -04:00
extension.c [ruby/yarp] Add source to ParseResult 2023-07-07 17:46:46 +00:00
extension.h Manual YARP resync 2023-07-05 16:58:55 -04:00
node.c [ruby/yarp] Resync YARP (#8098) 2023-07-19 16:15:01 -04:00
node.h [ruby/yarp] Resync YARP (#8098) 2023-07-19 16:15:01 -04:00
pack.c
pack.h Manual YARP resync 2023-07-05 16:58:55 -04:00
parser.h Manual YARP resync 2023-07-05 16:58:55 -04:00
prettyprint.c Manual YARP resync 2023-07-05 16:58:55 -04:00
regexp.c Manual YARP resync 2023-07-05 16:58:55 -04:00
regexp.h Manual YARP resync 2023-07-05 16:58:55 -04:00
serialize.c Sync ruby/yarp to 89a00203af 2023-06-22 09:23:07 -07:00
token_type.c
unescape.c Manual YARP resync 2023-07-05 16:58:55 -04:00
unescape.h Manual YARP resync 2023-07-05 16:58:55 -04:00
version.h Manual YARP resync 2023-07-05 16:58:55 -04:00
yarp.c [ruby/yarp] Fix heredocs inside %W and %w lists 2023-07-20 14:58:11 +00:00
yarp.h [ruby/yarp] Remove yp_location_for_node in preference of yp_newline_list_line_column 2023-07-11 15:49:42 +00:00
yarp_init.c Fix -Wold-style-definition 2023-06-21 13:51:39 -07:00