Skip to content

Commit

Permalink
include spec updates for change
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Hoekstra authored and martijnhoekstra committed Mar 8, 2021
1 parent f089d05 commit fedd2c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions spec/01-lexical-syntax.md
Expand Up @@ -503,9 +503,10 @@ not processed, except for Unicode escapes.
#### Interpolated string

```ebnf
interpolatedString ::= alphaid ‘"’ {printableChar \ (‘"’ | ‘$’) | escape} ‘"’
interpolatedString ::= alphaid ‘"’ {printableChar \ (‘"’ | ‘$’) | escape} ‘"’
| alphaid ‘"""’ {[‘"’] [‘"’] char \ (‘"’ | ‘$’) | escape} {‘"’} ‘"""’
escape ::= ‘$$’
escape ::= ‘$$’
| ‘$"’
| ‘$’ id
| ‘$’ BlockExpr
alphaid ::= upper idrest
Expand All @@ -522,13 +523,14 @@ or multi-line (triple quote).
Inside a interpolated string none of the usual escape characters are interpreted
(except for unicode escapes) no matter whether the string literal is normal
(enclosed in single quotes) or multi-line (enclosed in triple quotes).
Instead, there are two new forms of dollar sign escape.
Instead, there are three new forms of dollar sign escape.
The most general form encloses an expression in `${` and `}`, i.e. `${expr}`.
The expression enclosed in the braces that follow the leading `$` character is of
syntactical category BlockExpr. Hence, it can contain multiple statements,
and newlines are significant. Single ‘$’-signs are not permitted in isolation
in a interpolated string. A single ‘$’-sign can still be obtained by doubling the ‘$’
character: ‘$$’.
character: ‘$$’. A single ‘"’-sign in a single quoted interpolation would end the
interpolation. A single ‘"’-sign can be obtained by the sequence ‘\$"’.

The simpler form consists of a ‘$’-sign followed by an identifier starting with
a letter and followed only by letters, digits, and underscore characters,
Expand Down
5 changes: 3 additions & 2 deletions spec/13-syntax-summary.md
Expand Up @@ -63,8 +63,9 @@ multiLineChars ::= {[‘"’] [‘"’] charNoDoubleQuote} {‘"’}
interpolatedString
::= alphaid ‘"’ {printableChar \ (‘"’ | ‘\$’) | escape} ‘"’
| alphaid ‘"""’ {[‘"’] [‘"’] char \ (‘"’ | ‘\$’) | escape} {‘"’} ‘"""’
escape ::= ‘\$\$’
| ‘\$’ id
escape ::= ‘\$\$’
| ‘\$"’
| ‘\$’ id
| ‘\$’ BlockExpr
alphaid ::= upper idrest
| varid
Expand Down

0 comments on commit fedd2c9

Please sign in to comment.