infix
Create an infix operator, given a binding power and a function that evaluates the node.
def infix(
bp: int,
func: callable
) - > class
Create an infix operator, given a binding power and a function that evaluates the node.
Parameters
| Name | Type | Description |
|---|---|---|
| bp | int | The left binding power (lbp) which determines the operator precedence level during parsing |
| func | callable | A function that accepts a context and two operands to evaluate the result of the infix operation |
Returns
| Type | Description |
|---|---|
class | A new Operator class inheriting from TokenBase with the specified binding power and evaluation logic |