TokenMacro class final
A macro whose expansion is a list of tokens with #1…#9 parameters.
- Inheritance
-
- Object
- MacroDefinition
- TokenMacro
Constructors
-
TokenMacro(List<
Token> body, {int numArgs = 0, List<Token> ? optionalDefault, List<List< ? delimiters})Token> > -
Creates a macro from
bodytokens. -
TokenMacro.parse(String source, {int? numArgs, List<
Token> ? optionalDefault, List<List< ? delimiters})Token> > -
Creates a macro whose body is lexed from
sourceon first use.numArgsdefaults to the highest#ninsource.
Properties
-
body
→ List<
Token> -
The body tokens.
no setter
-
delimiters
→ List<
List< ?Token> > -
For
\defwith delimited parameters:delimiters[0]must follow the macro name,delimiters[i]ends argumenti. 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
#nused insource, 0 when none.