Skip to content

Class: PrimitiveMethod ​

Declaration of custom primitive operators - also known as operator overriding.

Example ​

ts
def ==(other)
end
def hash
end

Constructors ​

Constructor ​

new PrimitiveMethod(operator, equations, loc): PrimitiveMethod

Parameters ​

ParameterType
operatorOperator
equationsEquation[]
locSourceLocation

Returns ​

PrimitiveMethod

Overrides ​

ASTNode.constructor

Properties ​

PropertyType
equationsEquation[]
operatorOperator

Methods ​

dispatchVisit() ​

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

Type Parameters ​

Type Parameter
R

Parameters ​

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

Returns ​

R

Inherited from ​

ASTNode.dispatchVisit


getMetadata() ​

getMetadata<T>(key): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
keystring

Returns ​

T | undefined

Inherited from ​

ASTNode.getMetadata


hasMetadata() ​

hasMetadata(key): boolean

Parameters ​

ParameterType
keystring

Returns ​

boolean

Inherited from ​

ASTNode.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 ​

ASTNode.is


setMetadata() ​

setMetadata(key, value): void

Parameters ​

ParameterType
keystring
valueany

Returns ​

void

Inherited from ​

ASTNode.setMetadata


[hasInstance]() ​

static [hasInstance](instance): boolean

Parameters ​

ParameterType
instanceany

Returns ​

boolean

Inherited from ​

ASTNode.[hasInstance]