Basic function types.
This commit is contained in:
parent
a53388155a
commit
3b07cef209
@ -150,15 +150,51 @@ Function:
|
||||
build:
|
||||
type: boolean
|
||||
on: rule_present
|
||||
- modifier:
|
||||
rule: Modifier
|
||||
build: FunctionModifier
|
||||
- fn_kw:
|
||||
rule: Fn
|
||||
skip: true
|
||||
- generics:
|
||||
rule: GenericParameters
|
||||
optional: true
|
||||
- identifier
|
||||
- parameters
|
||||
- return_type:
|
||||
optional: true
|
||||
- function_body
|
||||
OperatorFunction:
|
||||
children:
|
||||
- is_public:
|
||||
rule: Pub
|
||||
build:
|
||||
type: boolean
|
||||
on: rule_present
|
||||
- op_kw:
|
||||
rule: Op
|
||||
skip: true
|
||||
- generics:
|
||||
rule: GenericParameters
|
||||
optional: true
|
||||
- operator
|
||||
- parameters
|
||||
- return_type:
|
||||
optional: true
|
||||
- function_body
|
||||
PlatformFunction:
|
||||
children:
|
||||
- is_public:
|
||||
rule: Pub
|
||||
build:
|
||||
type: boolean
|
||||
on: rule_present
|
||||
- platform_kw:
|
||||
rule: Platform
|
||||
skip: true
|
||||
- fn_kw:
|
||||
rule: Fn
|
||||
skip: true
|
||||
- generics:
|
||||
rule: GenericParameters
|
||||
optional: true
|
||||
- identifier
|
||||
- parameters
|
||||
- return_type
|
||||
- function_body
|
||||
|
@ -427,9 +427,8 @@ Class = {
|
||||
|
||||
// Function constructs
|
||||
|
||||
FunctionDefinition = {
|
||||
Function = {
|
||||
Pub?
|
||||
~ FunctionModifier?
|
||||
~ Fn
|
||||
~ GenericParameters?
|
||||
~ Identifier
|
||||
@ -438,9 +437,8 @@ FunctionDefinition = {
|
||||
~ FunctionBody
|
||||
}
|
||||
|
||||
OperatorFunctionDefinition = {
|
||||
OperatorFunction = {
|
||||
Pub?
|
||||
~ FunctionModifier?
|
||||
~ Op
|
||||
~ GenericParameters?
|
||||
~ Operator
|
||||
@ -451,14 +449,12 @@ OperatorFunctionDefinition = {
|
||||
|
||||
PlatformFunction = {
|
||||
Pub?
|
||||
~ FunctionModifier?
|
||||
~ Platform
|
||||
~ Fn
|
||||
~ GenericParameters?
|
||||
~ Identifier
|
||||
~ Parameters
|
||||
~ ReturnType
|
||||
~ ";"
|
||||
}
|
||||
|
||||
InterfaceFunction = {
|
||||
@ -501,13 +497,7 @@ InterfaceDefaultOperatorFunction = {
|
||||
~ FunctionBody
|
||||
}
|
||||
|
||||
FunctionModifier = {
|
||||
Static
|
||||
| Cons
|
||||
| Mut ~ Ref
|
||||
| Mut
|
||||
| Ref
|
||||
}
|
||||
// Function Components
|
||||
|
||||
FunctionBody = {
|
||||
FunctionAliasBody
|
||||
|
Loading…
Reference in New Issue
Block a user