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 {
14781478
14791479 /** SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody)
14801480 * | BlockExpr
1481- * | ‘'’ ‘{’ Block ‘}’
1482- * | ‘'’ ‘[’ Type ‘]’
14831481 * | ‘$’ ‘{’ Block ‘}’
1482+ * | Quoted
14841483 * | quoteId
14851484 * | SimpleExpr1 [`_']
14861485 * SimpleExpr1 ::= literal
@@ -1490,6 +1489,8 @@ object Parsers {
14901489 * | SimpleExpr `.' id
14911490 * | SimpleExpr (TypeArgs | NamedTypeArgs)
14921491 * | SimpleExpr1 ArgumentExprs
1492+ * Quoted ::= ‘'’ ‘{’ Block ‘}’
1493+ * | ‘'’ ‘[’ Type ‘]’
14931494 */
14941495 def simpleExpr (): Tree = {
14951496 var canApply = true
@@ -1827,6 +1828,7 @@ object Parsers {
18271828
18281829 /** SimplePattern ::= PatVar
18291830 * | Literal
1831+ * | Quoted
18301832 * | XmlPattern
18311833 * | `(' [Patterns] `)'
18321834 * | SimplePattern1 [TypeArgs] [ArgumentPatterns]
@@ -1853,6 +1855,8 @@ object Parsers {
18531855 } else wildIndent
18541856 case LPAREN =>
18551857 atSpan(in.offset) { makeTupleOrParens(inParens(patternsOpt())) }
1858+ case QUOTE =>
1859+ simpleExpr()
18561860 case XMLSTART =>
18571861 xmlLiteralPattern()
18581862 case _ =>
Original file line number Diff line number Diff line change @@ -209,9 +209,8 @@ InfixExpr ::= PrefixExpr
209209PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
210210SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
211211 | BlockExpr
212- | ‘'’ ‘{’ Block ‘}’
213- | ‘'’ ‘[’ Type ‘]’
214212 | ‘$’ ‘{’ Block ‘}’
213+ | Quoted
215214 | quoteId // only inside splices
216215 | SimpleExpr1 [‘_’] PostfixOp(expr, _)
217216SimpleExpr1 ::= Literal
@@ -222,6 +221,8 @@ SimpleExpr1 ::= Literal
222221 | SimpleExpr (TypeArgs | NamedTypeArgs) TypeApply(expr, args)
223222 | SimpleExpr1 ArgumentExprs Apply(expr, args)
224223 | XmlExpr
224+ Quoted ::= ‘'’ ‘{’ Block ‘}’
225+ | ‘'’ ‘[’ Type ‘]’
225226ExprsInParens ::= ExprInParens {‘,’ ExprInParens}
226227ExprInParens ::= PostfixExpr ‘:’ Type
227228 | Expr
@@ -261,6 +262,7 @@ InfixPattern ::= SimplePattern { id [nl] SimplePattern }
261262SimplePattern ::= PatVar Ident(wildcard)
262263 | Literal Bind(name, Ident(wildcard))
263264 | ‘(’ [Patterns] ‘)’ Parens(pats) Tuple(pats)
265+ | Quoted
264266 | XmlPattern
265267 | SimplePattern1 [TypeArgs] [ArgumentPatterns]
266268SimplePattern1 ::= Path
You can’t perform that action at this time.
0 commit comments