Table of Contents

Class ConstantDeclarationNode

Namespace
RDCore.SDK.Model.AST.Declarations
Assembly
RDCore.SDK.dll

An AST node representing a declared constant (child of either a member or a module node).

public record ConstantDeclarationNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<ConstantDeclarationNode>
Inheritance
ConstantDeclarationNode
Implements
Inherited Members
Extension Methods

Constructors

ConstantDeclarationNode(SyntaxNodeId, SourceLocation, string, ConstKind, ImmutableArray<SyntaxNode>, AccessModifier, string?, SourceRange?)

An AST node representing a declared constant (child of either a member or a module node).

public ConstantDeclarationNode(SyntaxNodeId Identity, SourceLocation Location, string Name, ConstKind ConstKind, ImmutableArray<SyntaxNode> Children, AccessModifier AccessModifier = AccessModifier.Implicit, string? TypeHint = null, SourceRange? NameRange = null)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

Location SourceLocation

The declaration as it is written. A statement that declares several constants has the keywords (Private Const) in front of the first of them, so the first one's range begins with the visibility or with Const, and the others' begin with their names.

Name string

The declared identifier name of the member.

ConstKind ConstKind

The scope kind of constant declaration.

Children ImmutableArray<SyntaxNode>
AccessModifier AccessModifier

An access modifier, if one was supplied.

TypeHint string

The type-declaration character (e.g. \(</code> in <code>Const Foo\)), if one was supplied.

NameRange SourceRange?

Where the name is written, with its type-declaration character; null when it is not known.

Properties

AccessModifier

An access modifier, if one was supplied.

public AccessModifier AccessModifier { get; init; }

Property Value

AccessModifier

ConstKind

The scope kind of constant declaration.

public ConstKind ConstKind { get; init; }

Property Value

ConstKind

Location

The declaration as it is written. A statement that declares several constants has the keywords (Private Const) in front of the first of them, so the first one's range begins with the visibility or with Const, and the others' begin with their names.

public SourceLocation Location { get; init; }

Property Value

SourceLocation

Name

The declared identifier name of the member.

public string Name { get; init; }

Property Value

string

NameRange

Where the name is written, with its type-declaration character; null when it is not known.

public SourceRange? NameRange { get; init; }

Property Value

SourceRange?

TypeHint

The type-declaration character (e.g. \(</code> in <code>Const Foo\)), if one was supplied.

public string? TypeHint { get; init; }

Property Value

string