StyleRule

class StyleRule(val pattern: ValidatedStylePattern, val instructions: NybbleArray, literals: List<String>)

A StyleRule is a pattern-matching program produced by a StylePatternCompiler. A runtime stylesheet aggregates all rules that should be considered when determining how Avail source text should be rendered.

Author

Todd L Smith

Parameters

pattern
instructions

The instructions that implement the pattern-matching program.

literals

The literal values recorded by the compiler, corresponding to the fixed style classifiers embedded in the pattern. Will be interned prior to internal storage, to accelerate matching during execution.

Constructors

Link copied to clipboard
constructor(pattern: ValidatedStylePattern, instructions: NybbleArray, literals: List<String>)

Construct a StyleRule.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The initial StyleRuleContext for running the receiver.

Link copied to clipboard

The instructions that implement the pattern-matching program.

Link copied to clipboard
Link copied to clipboard

The validated rendering context to apply when this rule is not obsoleted by a more specific rule during aggregate matching.

Link copied to clipboard

The source text whence the rule was compiled.

Functions

Link copied to clipboard
fun literalAt(index: Int): String

Answer the literal value at the requested index. Should generally only be invoked by a StyleRuleInstruction during its execution.

Link copied to clipboard
open override fun toString(): String