mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-09 10:49:32 +00:00
type constraints; tuple lifting
This commit is contained in:
@@ -137,7 +137,11 @@ pragma ::= '{.' optInd (colonExpr [comma])* optPar ('.}' | '}')
|
||||
param ::= symbol (comma symbol)* (':' typeDesc ['=' expr] | '=' expr)
|
||||
paramList ::= ['(' [param (comma param)*] optPar ')'] [':' typeDesc]
|
||||
|
||||
genericParam ::= symbol [':' typeDesc] ['=' expr]
|
||||
genericConstraint ::= 'object' | 'tuple' | 'enum' | 'proc' | 'ref' | 'ptr'
|
||||
| 'var' | 'distinct' | primary
|
||||
genericConstraints ::= genericConstraint ( '|' optInd genericConstraint )*
|
||||
|
||||
genericParam ::= symbol [':' genericConstraints] ['=' expr]
|
||||
genericParams ::= '[' genericParam (comma genericParam)* optPar ']'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user