Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a complex pattern match. Sets properties to expose structure. In the case of string properties, where we can't add provide the whole PatternMatch, we store that in a parallel object $valueMatches

deprecated

Prefer SuccessfulMatchReport; use matchReport.toValueStructure() to get the object structure or matchReport.toParseTree() to learn about how it matches

Hierarchy

Index

Constructors

constructor

  • new TreePatternMatch($matcherId: string, $matched: string, $offset: number): TreePatternMatch

Properties

$matched

$matched: string

the actual string content

$matcherId

$matcherId: string

id of the matcher that matched

$offset

$offset: number

offset from 0 in input

$value

$value: __type

$valueMatches

$valueMatches: object

Type declaration

Methods

matchedStructure

  • matchedStructure<T>(): T
  • Return just the structure that was matched, throwing away offset and matcher information. This is useful if you want to store PatternMatches after you're done with their internal information.

    Type parameters

    • T

    Returns T

Abstract submatches

  • submatches(): object

Generated using TypeDoc