From 1f908b420e4efe944ea764bbba239472c9c3cc92 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 15 May 2015 12:09:20 +0200 Subject: Allow AnnotatedType in operands of `with`. Brings in line with Scala 2 spec. --- docs/SyntaxSummary.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'docs/SyntaxSummary.txt') diff --git a/docs/SyntaxSummary.txt b/docs/SyntaxSummary.txt index e40b3fd6c..dadf15bed 100644 --- a/docs/SyntaxSummary.txt +++ b/docs/SyntaxSummary.txt @@ -99,8 +99,9 @@ grammar. FunArgTypes ::= InfixType | `(' [ FunArgType {`,' FunArgType } ] `)' InfixType ::= RefinedType {id [nl] RefinedType} InfixOp(t1, op, t2) - RefinedType ::= WithType {Annotation | [nl] Refinement} Annotated(t, annot), RefinedTypeTree(t, ds) - WithType ::= SimpleType {`with' SimpleType} (deprecated) + RefinedType ::= WithType {[nl] Refinement} RefinedTypeTree(t, ds) + WithType ::= AnnotType {`with' AnnotType} (deprecated) + AnnotType ::= SimpleType {Annotation} Annotated(t, annot) SimpleType ::= SimpleType TypeArgs AppliedTypeTree(t, args) | SimpleType `#' id SelectFromTypeTree(t, name) | StableId @@ -121,9 +122,9 @@ grammar. Expr ::= FunParams `=>' Expr Function(args, expr), Function(ValDef([implicit], id, TypeTree(), EmptyTree), expr) | Expr1 - FunParams ::= Bindings - | [`implicit'] id - | `_' + FunParams ::= Bindings + | [`implicit'] id + | `_' ExprInParens ::= PostfixExpr `:' Type | Expr BlockResult ::= (FunParams | [`implicit'] id `:' InfixType) => Block @@ -301,7 +302,7 @@ grammar. TemplateOpt ::= [`extends' Template | [nl] TemplateBody] Template ::= ConstrApps [TemplateBody] | TemplateBody Template(constr, parents, self, stats) ConstrApps ::= ConstrApp {`with' ConstrApp} - ConstrApp ::= SimpleType {ArgumentExprs} Apply(tp, args) + ConstrApp ::= AnnotType {ArgumentExprs} Apply(tp, args) ConstrExpr ::= SelfInvocation | ConstrBlock -- cgit v1.2.3