TokenRule class

One tokenizer rule: a type label, the pattern to match at the cursor, and whether matches are dropped (skip) instead of emitted.

Annotations

Constructors

TokenRule(String type, RegExp pattern, {bool shouldSkip = false})
Creates a rule labelled type matching pattern. Set shouldSkip for tokens to consume but not emit (whitespace, comments). Audited: 2026-06-12 11:26 EDT
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
pattern → RegExp
The pattern matched as a prefix at the current cursor position.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shouldSkip → bool
When true, matches advance the cursor but emit no token.
final
type → String
The label attached to tokens this rule produces (e.g. 'number').
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