ParseUtils class

Shared parsing utility functions for Handlers.

Generic helper methods extracted from CommandParser to avoid repetition across handlers.

Constructors

ParseUtils()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

delimiterFromName(String raw) → String
extractColorName(LatexNode node) → String
Extracts a color name string from a node.
extractCommandName(LatexNode node) → String
Extracts a command name from a node (removes the backslash).
extractDelimiter(LatexNode node) → String
Extracts a delimiter character from a parsed argument. Both literal delimiters and command forms such as \langle/\rVert are accepted.
extractText(List<LatexNode> nodes) → String
Extracts plain text from a list of nodes.
parseDimension(LatexParserContext ctx, LatexTokenStream stream) → String
Parses a TeX dimension either in braces ({1.2em}) or in the usual unbraced form (1.2em). Leading whitespace is ignored.
parseScriptContent(LatexParserContext ctx, LatexTokenStream stream) → LatexNode
Parses sub/superscript content (single factor or braced group).
parseScriptGroup(LatexParserContext ctx, LatexTokenStream stream) → (LatexNode?, LatexNode?)
Parses a script group {_a^b} and returns (sub, sup).
parseScriptsAndLimits(LatexParserContext ctx, LatexTokenStream stream) → (LatexNode?, LatexNode?, LimitsMode)
Parses following \limits/\nolimits and sub/superscripts. Returns a tuple of (subscript, superscript, limitsMode).
parseTensorIndicesGroup(LatexParserContext ctx, LatexTokenStream stream) → List<(bool, LatexNode)>
Parses a tensor indices list from a braced token stream.
parseUntil(LatexParserContext ctx, LatexTokenStream stream, bool condition(LatexToken)) → List<LatexNode>
Parses a list of nodes until the condition is met.