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