Skip to content

Conversation

@Earlopain
Copy link
Collaborator

These newlines are preserved, so in prism they will not create an extra line in the unescaped content.
Additionally, apply the same logic to interpolated regex nodes.

These newlines are preserved, so in prism they will not create an extra
line in the unescaped content.
Additionally, apply the same logic to interpolated regex nodes
.each do |lines|
escaped_lengths << lines.sum(&:bytesize)
unescaped_lines_count = lines.sum do |line|
next 0 if regex # Will always be preserved as is
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this if statement around the map here instead of checking each time?

@kddnewton kddnewton merged commit a122353 into ruby:main Jan 20, 2025
59 checks passed
@Earlopain Earlopain deleted the parser-translator-regex-fake-nl branch January 20, 2025 19:20
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