Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

escape LineTerminator in escape sequences template literal characters #118

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

IwanKaramazow
Copy link
Contributor

Interprets escape sequences in template characters as specified in:
https://tc39.es/ecma262/#prod-TemplateCharacter

The "LineTerminator" is part of "NonEscapeCharacter" in a "EscapeSequence"

Example:

`This is a long string with no\
carriage return`

related: https://forum.rescript-lang.org/t/syntax-to-break-long-single-line-strings

Interprets escape sequences in template characters as specified in:
https://tc39.es/ecma262/#prod-TemplateCharacter

The "LineTerminator" is part of "NonEscapeCharacter" in a "EscapeSequence"
@IwanKaramazow
Copy link
Contributor Author

IwanKaramazow commented Aug 26, 2020

If you want to use line breaks to make your source code easier to read, but you don’t want the line breaks to be part of the string’s value, write a backslash (\) at the end of those line.

@IwanKaramazow IwanKaramazow merged commit f6a714f into master Aug 26, 2020
@IwanKaramazow IwanKaramazow deleted the EscapedLineTerminatorTemplateStrings branch August 26, 2020 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant