Skip to content

Update reference syntax documentation with named tuples #23493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/_docs/reference/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ SimpleType ::= SimpleLiteral
| Singleton ‘.’ id
| Singleton ‘.’ ‘type’
| ‘(’ [Types] ‘)’
| ‘(’ NameAndType {‘,’ NameAndType} ‘)’
| Refinement
| SimpleType TypeArgs
| SimpleType ‘#’ id
Expand All @@ -220,6 +221,7 @@ ContextBounds ::= ContextBound
| '{' ContextBound {',' ContextBound} '}'
ContextBound ::= Type ['as' id]
Types ::= Type {‘,’ Type}
NameAndType ::= id ‘:’ Type
```

### Expressions
Expand Down Expand Up @@ -268,6 +270,7 @@ SimpleExpr ::= SimpleRef
| ‘new’ ConstrApp {‘with’ ConstrApp} [TemplateBody]
| ‘new’ TemplateBody
| ‘(’ [ExprsInParens] ‘)’
| ‘(’ NamedExprInParens {‘,’ NamedExprInParens} ‘)’
| SimpleExpr ‘.’ id
| SimpleExpr ‘.’ MatchClause
| SimpleExpr TypeArgs
Expand All @@ -287,6 +290,7 @@ ExprInParens ::= PostfixExpr ‘:’ Type | Expr
ParArgumentExprs ::= ‘(’ [ExprsInParens] ‘)’
| ‘(’ ‘using’ ExprsInParens ‘)’
| ‘(’ [ExprsInParens ‘,’] PostfixExpr ‘*’ ‘)’
NamedExprInParens ::= id ‘=’ ExprInParens
ArgumentExprs ::= ParArgumentExprs
| BlockExpr
BlockExpr ::= <<< (CaseClauses | Block) >>>
Expand Down Expand Up @@ -333,7 +337,9 @@ SimplePattern1 ::= SimpleRef
| SimplePattern1 ‘.’ id
PatVar ::= varid
| ‘_’
NamedPattern ::= id ‘=’ Pattern
Patterns ::= Pattern {‘,’ Pattern}
| NamedPattern {‘,’ NamedPattern}

ArgumentPatterns ::= ‘(’ [Patterns] ‘)’
| ‘(’ [Patterns ‘,’] PatVar ‘*’ ‘)’
Expand Down
Loading