Class: AsPattern
Represents an alias pattern (e.g., x@pat), binding the whole value to a name while matching inner patterns.
Example
ts
f p@(x, y) = ...Extends
BinaryPattern
Constructors
Constructor
new AsPattern(
left,right,loc?):AsPattern
Parameters
| Parameter | Type |
|---|---|
left | VariablePattern | WildcardPattern |
right | Pattern |
loc? | SourceLocation |
Returns
AsPattern
Overrides
BinaryPattern.constructor
Accessors
jsonType
Get Signature
get
protectedjsonType():BinaryPatternKind
Returns
BinaryPatternKind
Overrides
BinaryPattern.jsonType
Methods
getMetadata()
getMetadata<
T>(key):T
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
T
Inherited from
BinaryPattern.getMetadata
hasMetadata()
hasMetadata(
key):boolean
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
Inherited from
BinaryPattern.hasMetadata
is()
is<
T>(nodeType):this is T
Type Parameters
| Type Parameter |
|---|
T extends ASTNode |
Parameters
| Parameter | Type |
|---|---|
nodeType | (...args) => T |
Returns
this is T
Inherited from
BinaryPattern.is
setMetadata()
setMetadata(
key,value):void
Parameters
| Parameter | Type |
|---|---|
key | string |
value | any |
Returns
void
Inherited from
BinaryPattern.setMetadata