Table of Contents

Struct TokenMatch

Namespace
BlazOrbit.SyntaxHighlight.Tokens
Assembly
BlazOrbit.SyntaxHighlight.dll

Represents the result of a token rule match attempt.

public readonly struct TokenMatch

Constructors

TokenMatch(TokenType, int, int, IReadOnlyList<Token>?)

Represents the result of a token rule match attempt.

public TokenMatch(TokenType Type, int StartIndex, int Length, IReadOnlyList<Token>? NestedTokens = null)

Parameters

Type TokenType
StartIndex int
Length int
NestedTokens IReadOnlyList<Token>

Properties

EndIndex

Gets the end index of the match in the source text.

public int EndIndex { get; }

Property Value

int

HasNestedTokens

Gets a value indicating whether the match contains nested tokens.

public bool HasNestedTokens { get; }

Property Value

bool

Length

public int Length { get; init; }

Property Value

int

NestedTokens

public IReadOnlyList<Token>? NestedTokens { get; init; }

Property Value

IReadOnlyList<Token>

StartIndex

public int StartIndex { get; init; }

Property Value

int

Type

public TokenType Type { get; init; }

Property Value

TokenType