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

Refactor StringLiteral vs. TemplateLiteral #294

Merged
merged 2 commits into from
Jan 25, 2023
Merged

Refactor StringLiteral vs. TemplateLiteral #294

merged 2 commits into from
Jan 25, 2023

Conversation

edemaine
Copy link
Collaborator

Refactor StringLiteral vs. TemplateLiteral

  • StringLiteral is now always a string literal; no more BasicStringLiteral
  • TemplateLiteral now contains all CoffeeScript string interpolations (" and """ and even ''' which transpiles to a template literal), though occasionally returns StringLiteral when there is no interpolation.
  • Important to check for CoffeeScript double-quoted strings via TemplateLiteral before regular double-quoted strings via StringLiteral.

Bonus feature (separate first commit): add support for template literals as object keys (by wrapping in brackets).

* `StringLiteral` is now always a string literal;
  no more `BasicStringLiteral`
* `TemplateLiteral` now contains all CoffeeScript string interpolations
  (`"` and `"""` and even `'''` which transpiles to a template literal),
  though occasionally returns `StringLiteral` when there is no interpolation.
  * Fixes #289
* Important to check for CoffeeScript double-quoted strings via
  `TemplateLiteral` before regular double-quoted strings via `StringLiteral`.
@edemaine edemaine temporarily deployed to build January 25, 2023 22:42 — with GitHub Actions Inactive
@STRd6
Copy link
Contributor

STRd6 commented Jan 25, 2023

Nice!

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.

Coffeescript tagged template literals are broken
2 participants