Class FunctionDefinitionNode
- Namespace
- EzrSquared.Runtime.Nodes
- Assembly
- ezrSquared-lib.dll
The Node structure for a function definition.
public record FunctionDefinitionNode : Node
- Inheritance
-
objectFunctionDefinitionNode
- Inherited Members
Constructors
FunctionDefinitionNode(Node?, AccessMod, bool, IReadOnlyCollection<Node>, Node?, Node?, Node, Position, Position)
The Node structure for a function definition.
public FunctionDefinitionNode(Node? Name, AccessMod AccessibilityModifiers, bool ReturnLast, IReadOnlyCollection<Node> Parameters, Node? ExtraKeywordArguments, Node? ExtraPositionalArguments, Node Body, Position StartPosition, Position EndPosition)
Parameters
Name
NodeThe (optional) name of the function.
AccessibilityModifiers
AccessModThe accessibility modifiers for the function definition.
ReturnLast
boolThe check for if the last expression of the function should be returned as its result. Only used in oneliners.
Parameters
IReadOnlyCollection<Node>The parameters of the function.
ExtraKeywordArguments
NodeThe reference to store the extra keyword arguments in.
ExtraPositionalArguments
NodeThe reference to store the extra positional arguments in.
Body
NodeThe body of the function.
StartPosition
PositionThe starting Position of the FunctionDefinitionNode.
EndPosition
PositionThe ending Position of the FunctionDefinitionNode.
Properties
AccessibilityModifiers
The accessibility modifiers for the function definition.
public AccessMod AccessibilityModifiers { get; init; }
Property Value
Body
The body of the function.
public Node Body { get; init; }
Property Value
ExtraKeywordArguments
The reference to store the extra keyword arguments in.
public Node? ExtraKeywordArguments { get; init; }
Property Value
ExtraPositionalArguments
The reference to store the extra positional arguments in.
public Node? ExtraPositionalArguments { get; init; }
Property Value
Name
The (optional) name of the function.
public Node? Name { get; init; }
Property Value
Parameters
The parameters of the function.
public IReadOnlyCollection<Node> Parameters { get; init; }
Property Value
- IReadOnlyCollection<Node>
ReturnLast
The check for if the last expression of the function should be returned as its result. Only used in oneliners.
public bool ReturnLast { get; init; }
Property Value
- bool