Skip to content

Conversation

@Earlopain
Copy link
Collaborator

For example this:

_buf << ':
'

Prism currently converts tSTRING_BEG => tSTRING_CONTENT => tSTRING_END into a simple tSTRING token.

But, the parser gem doesn't do that when the string content ends with a newline.

Note that this is only an issue for strings spanning only two lines. When there are more lines, there are two tSTRING_CONTENT tokens so it falls through.

For example this:
```rb
_buf << ':
'
```

Prism currently converts `tSTRING_BEG` => `tSTRING_CONTENT` => `tSTRING_END` into a simple `tSTRING` token.

But, the parser gem doesn't do that when the string content ends with a newline.

Note that this is only an issue for strings spanning only two lines.
When there are more lines, there are two `tSTRING_CONTENT` tokens so it falls through.
@kddnewton kddnewton merged commit f5ae6d2 into ruby:main Dec 22, 2024
54 of 55 checks passed
@Earlopain Earlopain deleted the parser-translator-multiline-string-folding branch December 28, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants