Table of Contents

Class FunctionDefinitionNode

Namespace
EzrSquared.Runtime.Nodes
Assembly
ezrSquared-lib.dll

The Node structure for a function definition.

public record FunctionDefinitionNode : Node
Inheritance
object
FunctionDefinitionNode
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 Node

The (optional) name of the function.

AccessibilityModifiers AccessMod

The accessibility modifiers for the function definition.

ReturnLast bool

The 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 Node

The reference to store the extra keyword arguments in.

ExtraPositionalArguments Node

The reference to store the extra positional arguments in.

Body Node

The body of the function.

StartPosition Position

The starting Position of the FunctionDefinitionNode.

EndPosition Position

The ending Position of the FunctionDefinitionNode.

Properties

AccessibilityModifiers

The accessibility modifiers for the function definition.

public AccessMod AccessibilityModifiers { get; init; }

Property Value

AccessMod

Body

The body of the function.

public Node Body { get; init; }

Property Value

Node

ExtraKeywordArguments

The reference to store the extra keyword arguments in.

public Node? ExtraKeywordArguments { get; init; }

Property Value

Node

ExtraPositionalArguments

The reference to store the extra positional arguments in.

public Node? ExtraPositionalArguments { get; init; }

Property Value

Node

Name

The (optional) name of the function.

public Node? Name { get; init; }

Property Value

Node

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