ruby/yarp/util
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
..
yp_buffer.c
yp_buffer.h
yp_char.c [ruby/yarp] Fix heredocs inside %W and %w lists 2023-07-20 14:58:11 +00:00
yp_char.h [ruby/yarp] Fix heredocs inside %W and %w lists 2023-07-20 14:58:11 +00:00
yp_constant_pool.c
yp_constant_pool.h
yp_list.c
yp_list.h
yp_memchr.c
yp_memchr.h
yp_newline_list.c [ruby/yarp] Fix heredocs inside %W and %w lists 2023-07-20 14:58:11 +00:00
yp_newline_list.h
yp_state_stack.c
yp_state_stack.h
yp_string.c
yp_string.h
yp_string_list.c
yp_string_list.h
yp_strncasecmp.c
yp_strpbrk.c
yp_strpbrk.h