Skip to content

Class: WildcardPattern ​

Represents a wildcard pattern (_), which matches anything and discards the value.

Example ​

ts
const _ x = x

Extends ​

  • BasePattern

Constructors ​

Constructor ​

new WildcardPattern(loc?): WildcardPattern

Parameters ​

ParameterType
loc?SourceLocation

Returns ​

WildcardPattern

Inherited from ​

BasePattern.constructor

Accessors ​

jsonType ​

Get Signature ​

get protected jsonType(): YukigoPattern

Returns ​

YukigoPattern

Overrides ​

BasePattern.jsonType

Methods ​

dispatchVisit() ​

protected dispatchVisit<R>(visitor, callback?): R

Type Parameters ​

Type Parameter
R

Parameters ​

ParameterType
visitorVisitor<R>
callback?(node) => R

Returns ​

R

Inherited from ​

BasePattern.dispatchVisit


getMetadata() ​

getMetadata<T>(key): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
keystring

Returns ​

T | undefined

Inherited from ​

BasePattern.getMetadata


hasMetadata() ​

hasMetadata(key): boolean

Parameters ​

ParameterType
keystring

Returns ​

boolean

Inherited from ​

BasePattern.hasMetadata


is() ​

is<T>(nodeType): this is T

Type Parameters ​

Type Parameter
T extends ASTNode

Parameters ​

ParameterType
nodeType(...args) => T

Returns ​

this is T

Inherited from ​

BasePattern.is


setMetadata() ​

setMetadata(key, value): void

Parameters ​

ParameterType
keystring
valueany

Returns ​

void

Inherited from ​

BasePattern.setMetadata


toString() ​

toString(): string

Returns ​

string

Overrides ​

BasePattern.toString


[hasInstance]() ​

static [hasInstance](instance): boolean

Parameters ​

ParameterType
instanceany

Returns ​

boolean

Inherited from ​

BasePattern.[hasInstance]