Skip to content
ChartForgeX
Class

StorySourceText

ChartForgeX.Stories

Namespace
ChartForgeX.Stories
Assembly
ChartForgeX.Stories
Modifiers
sealed
Attributes
Fluent

Keeps exact source text together with optional dependency-free syntax spans. Tokenizers live in adapters and map their language-specific tokens into this model.

Inheritance

  • object
  • StorySourceText

Usage

Explore 14 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 7

Methods

AddSpan 2 overloads
public StorySourceText AddSpan(int start, int length, StorySyntaxKind kind) #

Adds one ordered syntax span.

Parameters

start int required
length int required
kind ChartForgeX.Stories.StorySyntaxKind required
public StorySourceText AddSpan(StorySourceSpan span) #

Adds one ordered syntax span.

Parameters

span ChartForgeX.Stories.StorySourceSpan required
public static StorySourceText Create(string text, string? language = null) #

Creates source text without language-specific dependencies.

Parameters

text string required
language string? = null optional

Properties

public string Text { get; } #

Gets the exact source text, including whitespace.

public string Language { get; set; } #

Gets or sets the optional language identifier used by hosts and accessibility output. Blank values clear it; values are trimmed.

public IReadOnlyList<StorySourceSpan> Spans { get; } #

Gets ordered, non-overlapping syntax spans.

Extension Methods

public static StorySourceText Language(StorySourceText storySourceText, string value) #

Sets StorySourceText.Language: Gets or sets the optional language identifier used by hosts and accessibility output. Blank values clear it; values are trimmed.

Parameters

storySourceText ChartForgeX.Stories.StorySourceText required
The instance.
value string required
The value.

Returns

StorySourceText The same instance.

Examples

// C# initializer or property        // C# fluent
storySourceText.Language = value;    storySourceText.Language(value);