Skip to content

Conversation

@Earlopain
Copy link
Collaborator

Mostly around newlines and line continuation.

  • percent arrays need special backslash handling in the ast
  • Fix offset issue for heredocs with many line continuations (used wrong variable as index access)
  • More refined rules on when to simplify string tokens
  • Handle line continuations in squiggly heredocs
  • Correctly dedent squiggly heredocs with interpolation
  • Consider ':foo: and %s[foo] to not be interpolation

Appologies for the amount of stuff

I sincerely hope this is the last of it for string handling. I'm not particularly proud of how this code evolved over the last PRs. It seems to handle a large chunk correctly and there are now an appropriate amount of tests so I might come back and try to clean it up a bit in the future.

#2539 can now be closed. All reported problems are now resolved, with this PR removing the last wrong offense from RuboCop for ruby-spec.

Mostly around newlines and line continuation.
* percent arrays need special backslash handling in the ast
* Fix offset issue for heredocs with many line continuations (used wrong variable as index access)
* More refined rules on when to simplify string tokens
* Handle line continuations in squiggly heredocs
* Correctly dedent squiggly heredocs with interpolation
* Consider `':foo:` and `%s[foo]` to not be interpolation
@Earlopain Earlopain force-pushed the parser-translator-better-strings branch from d1697b3 to 4edfe9d Compare January 15, 2025 22:24
@kddnewton kddnewton merged commit 6fdee87 into ruby:main Jan 16, 2025
56 of 57 checks passed
@Earlopain Earlopain deleted the parser-translator-better-strings branch January 17, 2025 10:42
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