TokenRule class final

Matches pattern and marks the match with scope.

captures maps capture group numbers inside pattern to scopes. Captured groups must appear in order and must not overlap.

Inheritance

Constructors

TokenRule(String pattern, {String? scope, Map<int, String> captures = const {}})
Creates a token rule.
const

Properties

captures → Map<int, String>
Scopes for capture groups inside pattern, keyed by group number.
final
hashCode → int
The hash code for this object.
no setterinherited
pattern → String
Regular expression source to match.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → String?
Scope for the whole match, or null for no scope.
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