Skip to content

Conversation

@ribru17
Copy link
Collaborator

@ribru17 ribru17 commented May 16, 2025

Problem: The end quote on a string was not marked as an immediate token, so trailing whitespace after string_content would not be captured by string_content, and would just be part of the string node, with no child.

Solution: Mark the end delimiter as an immediate token, meaning all trailing whitespace gets captured as string_content.

Popular languages like rust do this same thing with end quotes.

**Problem:** The end quote on a string was not marked as an immediate
token, so trailing whitespace after `string_content` would not be
captured by `string_content`, and would just be part of the `string`
node, with no child.

**Solution:** Mark the end delimiter as an immediate token, meaning all
trailing whitespace gets captured as `string_content`.
@clason clason force-pushed the string_whitespace branch from c7798b0 to ad7a716 Compare May 16, 2025 18:11
@clason clason merged commit e8c9cb3 into tree-sitter-grammars:master May 16, 2025
3 checks passed
@ribru17 ribru17 deleted the string_whitespace branch May 16, 2025 18:14
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