Specify several overlapped patterns in "AND" relation.

When matching a name, every branch of this pattern must extract the same number of name components, and their variables must be consistent.

When building a name, one branch is used to build the name as long as all required variables are present, and then the built name must match all branches.

Hierarchy (view full)

Constructors

Properties

branches: 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, any, any>

    Iterable of possible names.

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

    Parameters

    • name: Name

      Input name.

    Returns Iterable<Vars, any, any>

    • Iterable of extracted fields in possible interpretations.
  • Recognize part of the input name.

    Parameters

    • state: MatchState
    • branchIndex: number = 0
    • OptionallastMatch: MatchState

    Returns Iterable<MatchState, any, any>

    Iterable of potential matches.

  • Build part of an output name.

    Parameters

    Returns Iterable<BuildState, any, any>

    Iterable of potential constructions.