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
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
LocationSourceLocationThe 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 withConst, and the others' begin with their names.NamestringThe declared identifier name of the member.
ConstKindConstKindThe scope kind of constant declaration.
ChildrenImmutableArray<SyntaxNode>AccessModifierAccessModifierAn access modifier, if one was supplied.
TypeHintstringThe type-declaration character (e.g.
\(</code> in <code>Const Foo\)), if one was supplied.NameRangeSourceRange?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
ConstKind
The scope kind of constant declaration.
public ConstKind ConstKind { get; init; }
Property Value
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
Name
The declared identifier name of the member.
public string Name { get; init; }
Property Value
NameRange
Where the name is written, with its type-declaration character; null when it is not known.
public SourceRange? NameRange { get; init; }
Property Value
TypeHint
The type-declaration character (e.g. \(</code> in <code>Const Foo\)), if one was supplied.
public string? TypeHint { get; init; }