TokenRule constructor

const TokenRule(
  1. String type,
  2. RegExp pattern, {
  3. 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

Implementation

const TokenRule(this.type, this.pattern, {this.shouldSkip = false});