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
Whether this rule matches across tokens claimed by earlier rules (Prism greedy). A greedy match that starts in plain text swallows the tokens it overlaps, and the plain remainder is re-tokenized by the earlier rules: a string containing # or // stays a string even though the comment rule ran first. A non-greedy rule only matches within plain text.
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