Match or construct a variable name portion.

When matching a name, this pattern extracts a number of name components, and saves the sub-name in variables object in match() return value.

When building a name, this pattern succeeds if the variable is present in build() function argument.

Hierarchy

Constructors

Properties

filter?: Filter
id: string

variable name.

inner?: Pattern
maxComps: number
minComps: number

Methods

  • Build names following the structure of this pattern.

    Parameters

    • Rest ...varsL: VarsLike[]

      sets of variables to be replaced into the name.

    Returns Iterable<Name>

    an iterable of possible names.

  • Determine whether a name matches the structure of this pattern.

    Parameters

    • name: Name

      input name.

    Returns Iterable<Vars>

    an iterable of extracted fields in possible interpretations.

  • Recognize part of the input name.

    Parameters

    • state: MatchState

    Returns Iterable<MatchState>

    iterable of potential matches.

  • Build part of an output name.

    Parameters

    Returns Iterable<BuildState>

    iterable of potential constructions.

Generated using TypeDoc