TokenMacro class final

A macro whose expansion is a list of tokens with #1…#9 parameters.

Inheritance

Constructors

TokenMacro(List<Token> body, {int numArgs = 0, List<Token>? optionalDefault, List<List<Token>>? delimiters})
Creates a macro from body tokens.
TokenMacro.parse(String source, {int? numArgs, List<Token>? optionalDefault, List<List<Token>>? delimiters})
Creates a macro whose body is lexed from source on first use. numArgs defaults to the highest #n in source.

Properties

body → List<Token>
The body tokens.
no setter
delimiters → List<List<Token>>?
For \def with delimited parameters: delimiters[0] must follow the macro name, delimiters[i] ends argument i. Null for undelimited.
final
hashCode → int
The hash code for this object.
no setterinherited
numArgs → int
Number of arguments, including an optional first one.
final
optionalDefault → List<Token>?
When non-null, the first argument is optional ([…]) and defaults to these tokens.
final
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

highestParameter(String source) → int
The highest #n used in source, 0 when none.