@@ -506,7 +506,7 @@ object Parsers {
506
506
recur(top)
507
507
}
508
508
509
- /** operand { infixop operand | ‘with ’ (operand | ParArgumentExprs) } [postfixop],
509
+ /** operand { infixop operand | ‘given ’ (operand | ParArgumentExprs) } [postfixop],
510
510
*
511
511
* respecting rules of associativity and precedence.
512
512
* @param notAnOperator a token that does not count as operator.
@@ -1410,7 +1410,7 @@ object Parsers {
1410
1410
/** PostfixExpr ::= InfixExpr [id [nl]]
1411
1411
* InfixExpr ::= PrefixExpr
1412
1412
* | InfixExpr id [nl] InfixExpr
1413
- * | InfixExpr ‘with ’ (InfixExpr | ParArgumentExprs)
1413
+ * | InfixExpr ‘given ’ (InfixExpr | ParArgumentExprs)
1414
1414
*/
1415
1415
def postfixExpr (): Tree =
1416
1416
infixOps(prefixExpr(), canStartExpressionTokens, prefixExpr, maybePostfix = true )
@@ -2017,7 +2017,7 @@ object Parsers {
2017
2017
2018
2018
/** ClsParamClause ::= [nl | ‘with’] `(' [FunArgMods] [ClsParams] ')'
2019
2019
* ClsParams ::= ClsParam {`' ClsParam}
2020
- * ClsParam ::= {Annotation} [{Modifier } (`val' | `var') | `inline'] Param
2020
+ * ClsParam ::= {Annotation} [{ParamModifier } (`val' | `var') | `inline'] Param
2021
2021
* DefParamClause ::= [nl] `(' [FunArgMods] [DefParams] ')' | InferParamClause
2022
2022
* InferParamClause ::= ‘given’ (‘(’ DefParams ‘)’ | ContextTypes)
2023
2023
* ContextTypes ::= RefinedType {`,' RefinedType}
@@ -2675,7 +2675,7 @@ object Parsers {
2675
2675
}
2676
2676
2677
2677
/** TopStatSeq ::= TopStat {semi TopStat}
2678
- * TopStat ::= Annotations Modifiers TmplDef
2678
+ * TopStat ::= Annotations Modifiers Def
2679
2679
* | Packaging
2680
2680
* | package object objectDef
2681
2681
* | Import
@@ -2695,15 +2695,13 @@ object Parsers {
2695
2695
}
2696
2696
else if (in.token == IMPORT )
2697
2697
stats ++= importClause()
2698
- else if (in.token == AT || isTemplateIntro || isModifier )
2699
- stats +++= tmplDef (in.offset, defAnnotsMods(modifierTokens))
2698
+ else if (in.token == AT || isDefIntro(modifierTokens) )
2699
+ stats +++= defOrDcl (in.offset, defAnnotsMods(modifierTokens))
2700
2700
else if (! isStatSep) {
2701
2701
if (in.token == CASE )
2702
2702
syntaxErrorOrIncomplete(OnlyCaseClassOrCaseObjectAllowed ())
2703
2703
else
2704
2704
syntaxErrorOrIncomplete(ExpectedClassOrObjectDef ())
2705
- if (mustStartStat) // do parse all definitions even if they are probably local (i.e. a "}" has been forgotten)
2706
- defOrDcl(in.offset, defAnnotsMods(modifierTokens))
2707
2705
}
2708
2706
acceptStatSepUnlessAtEnd()
2709
2707
}
0 commit comments