declaration ::= attribute* (use-declaration |
type-declaration |
constant-declaration |
function-declaration |
test-declaration)
function-declaration ::= 'pub'? (function-declaration-signature block-expression |
'ext' function-declaration-signature ';')
function-declaration-signature ::= 'err'? 'fn' code-identifier function-parameter-list return-type-annotation?
function-parameter-list ::= '(' (function-parameter (',' function-parameter)* ','?)? ')'
function-parameter ::= attribute* function-parameter-binding type-annotation?
function-parameter-binding ::= binding-identifier
use-declaration ::= 'use' upper-identifier '=' module-path ';'
constant-declaration ::= 'pub'? 'const' code-identifier type-annotation? '=' expression ';'
test-declaration ::= 'test' code-identifier block-expression
type-declaration ::= ('pub' 'opaque'?)? 'type' lower-identifier type-parameter-list? '=' type ';'
type-parameter-list ::= '(' type-parameter (',' type-parameter)* ','? ')'
type-parameter ::= attribute* type-parameter-binding
type-parameter-binding ::= lower-identifier |
discard-identifier