@@ -27,7 +27,7 @@ upper ::= ‘A’ | … | ‘Z’ | ‘\$’ | ‘_’ “… and U
27
27
lower ::= ‘a’ | … | ‘z’ “… and Unicode category Ll” ;
28
28
letter ::= upper | lower “… and Unicode categories Lo, Lt, Lm, Nl” ;
29
29
digit ::= ‘0’ | … | ‘9’ ;
30
- paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ | ‘'(’ | ‘'[’ | ‘'{’ ;
30
+ paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ | ‘'(’ ;
31
31
delim ::= ‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’ ;
32
32
opchar ::= ‘!’ | ‘#’ | ‘%’ | ‘&’ | ‘*’ | ‘+’ | ‘-’ | ‘/’ | ‘:’ |
33
33
‘<’ | ‘=’ | ‘>’ | ‘?’ | ‘@’ | ‘\’ | ‘^’ | ‘|’ | ‘~’
@@ -45,6 +45,7 @@ id ::= plainid
45
45
| ‘`’ { charNoBackQuoteOrNewline | UnicodeEscape | charEscapeSeq } ‘`’ ;
46
46
idrest ::= {letter | digit} [‘_’ op] ;
47
47
quoteId ::= ‘'’ alphaid ;
48
+ spliceId ::= ‘'’ alphaid ;
48
49
49
50
integerLiteral ::= (decimalNumeral | hexNumeral) [‘L’ | ‘l’] ;
50
51
decimalNumeral ::= ‘0’ | nonZeroDigit [{digit | ‘_’} digit] ;
@@ -183,8 +184,7 @@ SimpleType1 ::= id
183
184
| Singleton ‘.’ ‘type’ SingletonTypeTree(p)
184
185
| ‘(’ Types ‘)’ Tuple(ts)
185
186
| Refinement RefinedTypeTree(EmptyTree, refinement)
186
- | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern
187
- | ‘$’ ‘{’ Pattern ‘}’ -- only inside quoted pattern
187
+ | TypeSplice -- deprecated syntax
188
188
| SimpleType1 TypeArgs AppliedTypeTree(t, args)
189
189
| SimpleType1 ‘#’ id Select(t, name) ;
190
190
Singleton ::= SimpleRef
@@ -243,8 +243,7 @@ SimpleExpr ::= SimpleRef
243
243
| Literal
244
244
| ‘_’
245
245
| BlockExpr
246
- | ‘$’ ‘{’ Block ‘}’ -- unless inside quoted pattern
247
- | ‘$’ ‘{’ Pattern ‘}’ -- only inside quoted pattern
246
+ | ExprSplice
248
247
| Quoted
249
248
| quoteId -- only inside splices
250
249
| ‘new’ ConstrApp {‘with’ ConstrApp} [TemplateBody] New(constr | templ)
@@ -261,6 +260,12 @@ SimpleExpr ::= SimpleRef
261
260
IndentedExpr ::= indent CaseClauses | Block outdent ;
262
261
Quoted ::= ‘'’ ‘{’ Block ‘}’
263
262
| ‘'’ ‘[’ 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
264
269
ExprsInParens ::= ExprInParens {‘,’ ExprInParens} ;
265
270
ExprInParens ::= PostfixExpr ‘:’ Type -- normal Expr allows only RefinedType here ;
266
271
| Expr
0 commit comments