Skip to content

Commit 8922323

Browse files
committed
Cleanup syntax
1 parent a8f2787 commit 8922323

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/docs/internals/syntax.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ Ascription ::= ‘:’ InfixType
209209
Catches ::= ‘catch’ Expr
210210
PostfixExpr ::= InfixExpr [id] PostfixOp(expr, op)
211211
InfixExpr ::= PrefixExpr
212-
| InfixExpr id [cnl] InfixExpr InfixOp(expr, op, expr)
212+
| InfixExpr id [nl] InfixExpr InfixOp(expr, op, expr)
213213
| InfixExpr ‘given’ (InfixExpr | ParArgumentExprs)
214214
PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
215-
SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
215+
SimpleExpr ::= Path
216+
| Literal
217+
| ‘_’
216218
| BlockExpr
217219
| ‘$’ ‘{’ Block ‘}’
218220
| Quoted
219221
| quoteId // only inside splices
220-
| SimpleExpr1 [‘_’] PostfixOp(expr, _)
221-
SimpleExpr1 ::= Literal
222-
| Path
223-
| ‘_’
222+
| ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
224223
| ‘(’ ExprsInParens ‘)’ Parens(exprs)
225224
| SimpleExpr ‘.’ id Select(expr, id)
226-
| SimpleExpr (TypeArgs | NamedTypeArgs) TypeApply(expr, args)
227-
| SimpleExpr1 ArgumentExprs Apply(expr, args)
225+
| SimpleExpr TypeArgs TypeApply(expr, args)
226+
| SimpleExpr ArgumentExprs Apply(expr, args)
227+
| SimpleExpr ‘_’ PostfixOp(expr, _)
228228
| XmlExpr
229229
Quoted ::= ‘'’ ‘{’ Block ‘}’
230230
| ‘'’ ‘[’ Type ‘]’
@@ -234,8 +234,8 @@ ExprInParens ::= PostfixExpr ‘:’ Type
234234
ParArgumentExprs ::= ‘(’ [‘given’] ExprsInParens ‘)’ exprs
235235
| ‘(’ [ExprsInParens ‘,’] PostfixExpr ‘:’ ‘_’ ‘*’ ‘)’ exprs :+ Typed(expr, Ident(wildcardStar))
236236
ArgumentExprs ::= ParArgumentExprs
237-
| [cnl] BlockExpr
238-
BlockExpr ::= ‘{’ CaseClauses | Block ‘}’
237+
| [nl] BlockExpr
238+
BlockExpr ::= ‘{’ (CaseClauses | Block) ‘}’
239239
Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?)
240240
BlockStat ::= Import
241241
| {Annotation [nl]} [‘implicit’ | ‘lazy’] Def
@@ -263,7 +263,7 @@ Pattern ::= Pattern1 { ‘|’ Pattern1 }
263263
Pattern1 ::= Pattern2 [‘:’ RefinedType] Bind(name, Typed(Ident(wildcard), tpe))
264264
| ‘given’ PatVar ‘:’ RefinedType
265265
Pattern2 ::= [id ‘@’] InfixPattern Bind(name, pat)
266-
InfixPattern ::= SimplePattern { id [cnl] SimplePattern } InfixOp(pat, op, pat)
266+
InfixPattern ::= SimplePattern { id [nl] SimplePattern } InfixOp(pat, op, pat)
267267
SimplePattern ::= PatVar Ident(wildcard)
268268
| Literal Bind(name, Ident(wildcard))
269269
| ‘(’ [Patterns] ‘)’ Parens(pats) Tuple(pats)
@@ -400,7 +400,7 @@ ConstrExpr ::= SelfInvocation
400400
| ‘{’ SelfInvocation {semi BlockStat} ‘}’
401401
SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
402402
403-
TemplateBody ::= [cnl] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
403+
TemplateBody ::= [nl] ‘{’ [SelfType] TemplateStat {semi TemplateStat} ‘}’ (self, stats)
404404
TemplateStat ::= Import
405405
| Export
406406
| {Annotation [nl]} {Modifier} Def
@@ -410,7 +410,7 @@ TemplateStat ::= Import
410410
SelfType ::= id [‘:’ InfixType] ‘=>’ ValDef(_, name, tpt, _)
411411
| ‘this’ ‘:’ InfixType ‘=>’
412412
413-
EnumBody ::= [cnl] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
413+
EnumBody ::= [nl] ‘{’ [SelfType] EnumStat {semi EnumStat} ‘}’
414414
EnumStat ::= TemplateStat
415415
| {Annotation [nl]} {Modifier} EnumCase
416416
EnumCase ::= ‘case’ (id ClassConstr [‘extends’ ConstrApps]] | ids)
@@ -422,7 +422,7 @@ TopStat ::= Import
422422
| Packaging
423423
| PackageObject
424424
|
425-
Packaging ::= ‘package’ QualId [cnl] ‘{’ TopStatSeq ‘}’ Package(qid, stats)
425+
Packaging ::= ‘package’ QualId [nl] ‘{’ TopStatSeq ‘}’ Package(qid, stats)
426426
PackageObject ::= ‘package’ ‘object’ ObjectDef object with package in mods.
427427
428428
CompilationUnit ::= {‘package’ QualId (semi | cnl)} TopStatSeq Package(qid, stats)

0 commit comments

Comments
 (0)