diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2023-11-09 23:50:26 -0500 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2023-11-21 11:35:46 -0500 |
| commit | ddacc0852895adfe3ffec83cdb79ba21f6db169f (patch) | |
| tree | dec8c93fcdc89cc58d06090e80270c2ed999c588 /test/ruby/test_transcode.rb | |
| parent | 903b0931a116691386e71fa30fb1698bbd785853 (diff) | |
[ruby/prism] Remove string concat in favor of a flat list
Right now when you have a lot of string concats it ends up being
difficult to work with because of the depth of the tree. You end
up descending very far for every string literal that is part of the
concat.
There are already times when we use an interpolated string node to
group together two string segments that are part of the same string
(like when they are interupted by the contents of a heredoc). This
commit takes the same approach and replaces string concats with
interpolated string nodes.
Now that they're a flat list, they should be much easier to work
with. There's still some missing information here that would be
useful to consumers: whether or not there is _actually_ any
interpolation contained in the list. We could remedy this with
another node type that is named something like string list, or we
could add a flag to interpolated string node indicating that there
is interpolation. Either way I want to solve that in a follow-up
commit, since this commit is valuable on its own.
https://github.com/ruby/prism/commit/1e7ae3ad1b
Diffstat (limited to 'test/ruby/test_transcode.rb')
0 files changed, 0 insertions, 0 deletions
