Specify several alternate patterns in "OR" relation.

When matching a name, the first successful match is returned.

When building a name, the first choice that does not have missing variable is returned.

Hierarchy

Constructors

Properties

choices: Pattern[] = []

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