@@ -27,7 +27,7 @@ upper ::= ‘A’ | … | ‘Z’ | ‘\$’ | ‘_’ “… and U
2727lower ::= ‘a’ | … | ‘z’ “… and Unicode category Ll”
2828letter ::= upper | lower “… and Unicode categories Lo, Lt, Lm, Nl”
2929digit ::= ‘0’ | … | ‘9’
30- paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ | ‘'(’ | ‘'[’ | ‘'{’
30+ paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’
3131delim ::= ‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’
3232opchar ::= ‘!’ | ‘#’ | ‘%’ | ‘&’ | ‘*’ | ‘+’ | ‘-’ | ‘/’ | ‘:’ |
3333 ‘<’ | ‘=’ | ‘>’ | ‘?’ | ‘@’ | ‘\’ | ‘^’ | ‘|’ | ‘~’
@@ -45,6 +45,7 @@ id ::= plainid
4545 | ‘`’ { charNoBackQuoteOrNewline | UnicodeEscape | charEscapeSeq } ‘`’
4646idrest ::= {letter | digit} [‘_’ op]
4747quoteId ::= ‘'’ alphaid
48+ spliceId ::= ‘$’ alphaid ;
4849
4950integerLiteral ::= (decimalNumeral | hexNumeral) [‘L’ | ‘l’]
5051decimalNumeral ::= ‘0’ | nonZeroDigit [{digit | ‘_’} digit]
@@ -183,8 +184,7 @@ SimpleType1 ::= id
183184 | Singleton ‘.’ ‘type’ SingletonTypeTree(p)
184185 | ‘(’ Types ‘)’ Tuple(ts)
185186 | Refinement RefinedTypeTree(EmptyTree, refinement)
186- | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern
187- | ‘$’ ‘{’ Pattern ‘}’ -- only inside quoted pattern
187+ | TypeSplice -- deprecated syntax
188188 | SimpleType1 TypeArgs AppliedTypeTree(t, args)
189189 | SimpleType1 ‘#’ id Select(t, name)
190190Singleton ::= SimpleRef
@@ -243,8 +243,7 @@ SimpleExpr ::= SimpleRef
243243 | Literal
244244 | ‘_’
245245 | BlockExpr
246- | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern
247- | ‘$’ ‘{’ Pattern ‘}’ -- only inside quoted pattern
246+ | ExprSplice
248247 | Quoted
249248 | quoteId -- only inside splices
250249 | ‘new’ ConstrApp {‘with’ ConstrApp} [TemplateBody] New(constr | templ)
@@ -259,8 +258,14 @@ SimpleExpr ::= SimpleRef
259258 | SimpleExpr ‘_’ PostfixOp(expr, _) (to be dropped)
260259 | XmlExpr -- to be dropped
261260IndentedExpr ::= indent CaseClauses | Block outdent
262- Quoted ::= ‘'’ ‘{’ Block ‘}’
261+ Quoted ::= ‘'’ ‘{’ Block ‘}’
263262 | ‘'’ ‘[’ Type ‘]’
263+ ExprSplice ::= spliceId -- if inside quoted block
264+ | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern
265+ | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted pattern
266+ TypeSplice ::= spliceId -- if inside quoted type -- deprecated syntax
267+ | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted type pattern -- deprecated syntax
268+ | ‘$’ ‘{’ Pattern ‘}’ -- when inside quoted type pattern -- deprecated syntax
264269ExprsInParens ::= ExprInParens {‘,’ ExprInParens}
265270ExprInParens ::= PostfixExpr ‘:’ Type -- normal Expr allows only RefinedType here
266271 | Expr
0 commit comments