From fedd2c94dbd601560b7e9f1529f5e05fa1c8b678 Mon Sep 17 00:00:00 2001 From: Martijn Hoekstra Date: Thu, 19 Jul 2018 10:15:09 +0200 Subject: [PATCH] include spec updates for change --- spec/01-lexical-syntax.md | 10 ++++++---- spec/13-syntax-summary.md | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spec/01-lexical-syntax.md b/spec/01-lexical-syntax.md index e240ef372ffa..c345935941b9 100644 --- a/spec/01-lexical-syntax.md +++ b/spec/01-lexical-syntax.md @@ -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 @@ -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, diff --git a/spec/13-syntax-summary.md b/spec/13-syntax-summary.md index 837054f5a772..442d76adb7a4 100644 --- a/spec/13-syntax-summary.md +++ b/spec/13-syntax-summary.md @@ -63,8 +63,9 @@ multiLineChars ::= {[‘"’] [‘"’] charNoDoubleQuote} {‘"’} interpolatedString ::= alphaid ‘"’ {printableChar \ (‘"’ | ‘\$’) | escape} ‘"’ | alphaid ‘"""’ {[‘"’] [‘"’] char \ (‘"’ | ‘\$’) | escape} {‘"’} ‘"""’ -escape ::= ‘\$\$’ - | ‘\$’ id +escape ::= ‘\$\$’ + | ‘\$"’ + | ‘\$’ id | ‘\$’ BlockExpr alphaid ::= upper idrest | varid