File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1478,9 +1478,8 @@ object Parsers {
1478
1478
1479
1479
/** SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody)
1480
1480
* | BlockExpr
1481
- * | ‘'’ ‘{’ Block ‘}’
1482
- * | ‘'’ ‘[’ Type ‘]’
1483
1481
* | ‘$’ ‘{’ Block ‘}’
1482
+ * | Quoted
1484
1483
* | quoteId
1485
1484
* | SimpleExpr1 [`_']
1486
1485
* SimpleExpr1 ::= literal
@@ -1490,6 +1489,8 @@ object Parsers {
1490
1489
* | SimpleExpr `.' id
1491
1490
* | SimpleExpr (TypeArgs | NamedTypeArgs)
1492
1491
* | SimpleExpr1 ArgumentExprs
1492
+ * Quoted ::= ‘'’ ‘{’ Block ‘}’
1493
+ * | ‘'’ ‘[’ Type ‘]’
1493
1494
*/
1494
1495
def simpleExpr (): Tree = {
1495
1496
var canApply = true
@@ -1827,6 +1828,7 @@ object Parsers {
1827
1828
1828
1829
/** SimplePattern ::= PatVar
1829
1830
* | Literal
1831
+ * | Quoted
1830
1832
* | XmlPattern
1831
1833
* | `(' [Patterns] `)'
1832
1834
* | SimplePattern1 [TypeArgs] [ArgumentPatterns]
@@ -1853,6 +1855,8 @@ object Parsers {
1853
1855
} else wildIndent
1854
1856
case LPAREN =>
1855
1857
atSpan(in.offset) { makeTupleOrParens(inParens(patternsOpt())) }
1858
+ case QUOTE =>
1859
+ simpleExpr()
1856
1860
case XMLSTART =>
1857
1861
xmlLiteralPattern()
1858
1862
case _ =>
Original file line number Diff line number Diff line change @@ -209,9 +209,8 @@ InfixExpr ::= PrefixExpr
209
209
PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
210
210
SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
211
211
| BlockExpr
212
- | ‘'’ ‘{’ Block ‘}’
213
- | ‘'’ ‘[’ Type ‘]’
214
212
| ‘$’ ‘{’ Block ‘}’
213
+ | Quoted
215
214
| quoteId // only inside splices
216
215
| SimpleExpr1 [‘_’] PostfixOp(expr, _)
217
216
SimpleExpr1 ::= Literal
@@ -222,6 +221,8 @@ SimpleExpr1 ::= Literal
222
221
| SimpleExpr (TypeArgs | NamedTypeArgs) TypeApply(expr, args)
223
222
| SimpleExpr1 ArgumentExprs Apply(expr, args)
224
223
| XmlExpr
224
+ Quoted ::= ‘'’ ‘{’ Block ‘}’
225
+ | ‘'’ ‘[’ Type ‘]’
225
226
ExprsInParens ::= ExprInParens {‘,’ ExprInParens}
226
227
ExprInParens ::= PostfixExpr ‘:’ Type
227
228
| Expr
@@ -261,6 +262,7 @@ InfixPattern ::= SimplePattern { id [nl] SimplePattern }
261
262
SimplePattern ::= PatVar Ident(wildcard)
262
263
| Literal Bind(name, Ident(wildcard))
263
264
| ‘(’ [Patterns] ‘)’ Parens(pats) Tuple(pats)
265
+ | Quoted
264
266
| XmlPattern
265
267
| SimplePattern1 [TypeArgs] [ArgumentPatterns]
266
268
SimplePattern1 ::= Path
You can’t perform that action at this time.
0 commit comments