Docsv3.31.0
Back to API Reference
Struct

RangeQuery

sealed

Declarative selection of a modifier's materialized ranges. Immutable; every filter returns a new query, filters combine with AND. Materialize with Collect.

public BaseModifier Target{ get }

The modifier whose ranges the query selects.

public static RangeQuery For(BaseModifier modifier)

Selects every materialized range of modifier.

public RangeQuery WhereParameter(ParameterDescriptor<TModifier,TValue> parameter, TValue value)

Keeps ranges whose markup token for parameter parses to a value equal to value. Ranges without the token never match.

public RangeQuery WhereToken(ParameterDescriptor parameter, string token)

Keeps ranges whose raw markup token for parameter equals token (ordinal).

public RangeQuery WhereBare()

Keeps only ranges authored without any explicit parameter token (bare tags).

public RangeQuery WherePrimaryValue(string value)

Keeps ranges whose source-emitted semantic value equals value (ordinal).

public RangeQuery WhereChannel(RangeChannel value)

Keeps ranges routed through value.

public RangeQuery Intersecting(TextRange value)

Keeps ranges overlapping value by at least one codepoint.

public RangeQuery Within(TextRange value)

Keeps ranges lying entirely inside value.

public RangeQuery WhereLabel(string value)

Keeps ranges whose tag carries the #label anchor equal to value (ordinal).

public RangeQuery Take(int count)

Keeps at most count ranges after Skip; zero keeps all.

public RangeQuery Where(ModifierRangePredicate filter)

Keeps ranges accepted by filter; multiple calls combine with AND.

public void Collect(List<ModifierRange> results)

Collects the matching ranges of the current parse into results, in text order.

public OwnedParameterSet<TModifier,TValue> Own(ParameterDescriptor<TModifier,TValue> parameter, ParameterComposition composition = ParameterComposition.Replace, int priority = 0)

Takes standing ownership of one parameter across every range this query matches, now and after every future parse; release the set to return them all to their cascades.

public bool Matches(in ModifierRange range)

Returns whether one materialized range passes every configured filter.