Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Repetition

Handle repetition, with or without a separator. Prefer subclasses for simplicity and clarity. By default, match zero or more times without a separator

Hierarchy

Implements

Index

Constructors

constructor

  • new Repetition(o: any, min?: number, sep?: any): Repetition
  • Generic rep support. Normally use subclasses.

    Parameters

    • o: any

      matcher

    • Default value min: number = 0

      mininum number of times the matcher must match for this to be considered a match. Default 0

    • Optional sep: any

      if this is provided it indicates that this is a rep sep and it is the delimiter

    Returns Repetition

Properties

$consumeWhiteSpaceBetweenTokens

$consumeWhiteSpaceBetweenTokens: boolean = true

Private matcher

matcher: MatchingLogic

min

min: number

mininum number of times the matcher must match for this to be considered a match. Default 0

Optional sep

sep: any

if this is provided it indicates that this is a rep sep and it is the delimiter

Private sepMatcher

sepMatcher: MatchingLogic

Accessors

$id

  • get $id(): string

requiredPrefix

  • get requiredPrefix(): string

Methods

canStartWith

  • canStartWith(char: string): boolean

consumeWhiteSpace

  • consumeWhiteSpace(consumeWhiteSpaceBetweenTokens: boolean): this
  • Parameters

    • consumeWhiteSpaceBetweenTokens: boolean

    Returns this

matchPrefix

matchPrefixReport

Generated using TypeDoc