Skip to content

TextToken

StructTextStudioTextStudio
public struct TextToken

Flat token struct output by the tokenizer. References ranges into the source text via indices.

public TokenKind kind

Returns

TextStudio.TokenKind

public int sourceStart

Returns

System.Int32

public int sourceEnd

Returns

System.Int32

public int nameHash

Returns

System.Int32

public int parameterStart

Returns

System.Int32

public int parameterEnd

Returns

System.Int32

public int nestingDepth

Returns

System.Int32

public int outerStart

Returns

System.Int32

public int outerEnd

Returns

System.Int32

public int nameEnd

Returns

System.Int32

public bool selfClosing

Returns

System.Boolean

public ReadOnlySpan<char> GetNameSpan(string source)

Gets the tag-name slice from the original source without allocating.

Parameters

Name Type
source System.String

Returns

System.ReadOnlySpan{System.Char}

public ReadOnlySpan<char> GetParameterSpan(string source)

Gets the raw parameter slice from the original source without allocating.

Parameters

Name Type
source System.String

Returns

System.ReadOnlySpan{System.Char}

public int Length { get; }

Returns

System.Int32