Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/fix string interpolation model #20

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

ckipp01
Copy link
Collaborator

@ckipp01 ckipp01 commented Mar 12, 2021

This pr changes and enhances a bit of the way that string interpolation in modeled. Closes #14

Naming change

string_transform_expression -> interpolated_string_expression

Behavioral changes

Previously interpolated strings were anything that contained a $(identifier) or ${identifier} where now it must be a seq of identifier and followed by a string.

Previously in interpolate_string_expressions the string was just a string. We now make a small distinction and the string inside of the interpolated_string_expression is a interpolated_string just to bring a bit more clarity.


val string2 = "$a"
val string2 = f"hi $name%s"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One future thing we can enhance even further here is identifying the formatters as identifiers, but for now there are a ton of other things that are probably more important to tackle than fine graining this.

@maxbrunsfeld maxbrunsfeld merged commit f7721fd into tree-sitter:master Mar 12, 2021
@maxbrunsfeld
Copy link
Contributor

Awesome!

@ckipp01 ckipp01 deleted the string branch March 12, 2021 18:21
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.

Change the way interpolation is modeled.
2 participants