Skip to content

Commit 6635929

Browse files
authored
Merge pull request #15424 from som-snytt/doc/tweak-given-with-template
Tweak given structural instance with template body
2 parents 836ed97 + 5821bbf commit 6635929

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/_docs/internals/syntax.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ ObjectDef ::= id [Template]
440440
EnumDef ::= id ClassConstr InheritClauses EnumBody
441441
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance)
442442
GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefParamClause`, `UsingParamClause` must be present
443-
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ TemplateBody]
443+
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ WithTemplateBody]
444444
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}
445445
‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
446446
ExtMethods ::= ExtMethod | [nl] <<< ExtMethod {semi ExtMethod} >>>
@@ -454,6 +454,7 @@ ConstrExpr ::= SelfInvocation
454454
| <<< SelfInvocation {semi BlockStat} >>>
455455
SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
456456
457+
WithTemplateBody ::= <<< [SelfType] TemplateStat {semi TemplateStat} >>>
457458
TemplateBody ::= :<<< [SelfType] TemplateStat {semi TemplateStat} >>>
458459
TemplateStat ::= Import
459460
| Export

docs/_docs/reference/syntax.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ ObjectDef ::= id [Template]
423423
EnumDef ::= id ClassConstr InheritClauses EnumBody
424424
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance)
425425
GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefParamClause`, `UsingParamClause` must be present
426-
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ TemplateBody]
426+
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ WithTemplateBody]
427427
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}
428428
‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
429429
ExtMethods ::= ExtMethod | [nl] <<< ExtMethod {semi ExtMethod} >>>
@@ -437,6 +437,7 @@ ConstrExpr ::= SelfInvocation
437437
| <<< SelfInvocation {semi BlockStat} >>>
438438
SelfInvocation ::= ‘this’ ArgumentExprs {ArgumentExprs}
439439
440+
WithTemplateBody ::= <<< [SelfType] TemplateStat {semi TemplateStat} >>>
440441
TemplateBody ::= :<<< [SelfType] TemplateStat {semi TemplateStat} >>>
441442
TemplateStat ::= Import
442443
| Export

0 commit comments

Comments
 (0)