GrammarToken class final

One rule of a Grammar: a pattern whose matches are tagged with type (and optionally re-tagged via alias), with optional nested highlighting via inside.

Constructors

GrammarToken(String type, RegExp pattern, {bool lookbehind = false, bool greedy = false, String? alias, Grammar inside()?})
One rule of a Grammar: a pattern whose matches are tagged with type (and optionally re-tagged via alias), with optional nested highlighting via inside.

Properties

alias String?
An alternative type name that takes precedence over type when resolving a style (e.g. Dart's metadata is aliased to function).
final
greedy bool
A "greedy" flag, retained for fidelity. The current tokenizer relies on grammar ordering rather than greedy re-scanning, so this is advisory.
final
hashCode int
The hash code for this object.
no setterinherited
inside Grammar?
The nested grammar used to tokenize this rule's matched text, or null.
no setter
lookbehind bool
A "lookbehind" flag: when true, capture group 1 of pattern is treated as an unstyled prefix and excluded from the emitted token (it is not a regex look-behind assertion).
final
pattern RegExp
The pattern whose matches become tokens of this type.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The token type (the grammar key), used to look up a style in the theme.
final

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