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

[Syntax lookup] Add doc for explicit string interpolation #404

Merged

Conversation

kellydanma
Copy link
Contributor

@kellydanma kellydanma commented Jun 25, 2021

Another proposal for #162

  • `` (explicit string interpolation)

@kellydanma kellydanma force-pushed the kellydanma/implicit_string_literal branch from 5872eee to 009bac4 Compare June 25, 2021 15:25
@kellydanma kellydanma marked this pull request as ready for review June 25, 2021 15:27
@ryyppy
Copy link
Member

ryyppy commented Jul 13, 2021

Probably a mistake from my side for defining it as a explicit string interpolation syntax... it should actually just be called string interpolation syntax.

The older formats like j`` should not be used anymore anyways.

@@ -0,0 +1,34 @@
---
Copy link
Member

Choose a reason for hiding this comment

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

File should be called language_string_interpolation.mdx

@@ -0,0 +1,34 @@
---
id: "explicit-string-interpolation"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
id: "explicit-string-interpolation"
id: "string-interpolation"

id: "explicit-string-interpolation"
keywords: ["string", "interpolation"]
name: "``"
summary: "This is the explicit `string` interpolation syntax."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
summary: "This is the explicit `string` interpolation syntax."
summary: "This is the `string interpolation` syntax."

category: "languageconstructs"
---

An explicit `string` interpolation is composed of two backticks. It works like JavaScript's backtick string interpolation without the need to escape special characters.
Copy link
Member

@ryyppy ryyppy Jul 13, 2021

Choose a reason for hiding this comment

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

Suggested change
An explicit `string` interpolation is composed of two backticks. It works like JavaScript's backtick string interpolation without the need to escape special characters.
A `string interpolation` is composed of two backticks. It allows unicode characters and embeddable values and expressions with the special `${myValue}` syntax.

@ryyppy
Copy link
Member

ryyppy commented Sep 8, 2021

That's so cool! Thanks.

Small tip: If there are comments with suggestions, you should be able to just accept a change on Github's UI to automatically commit the diff. That's easier than trying to copy/paste the diff yourself :-)

@ryyppy ryyppy merged commit 9e11bf6 into rescript-lang:master Sep 8, 2021
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