lang: define operator arity and position
This commit is contained in:
@@ -29,6 +29,17 @@ enum ivy_operator_associativity {
|
||||
IVY_ASSOCIATIVITY_RIGHT,
|
||||
};
|
||||
|
||||
enum ivy_operator_location {
|
||||
IVY_OP_PREFIX,
|
||||
IVY_OP_INFIX,
|
||||
IVY_OP_POSTFIX,
|
||||
};
|
||||
|
||||
enum ivy_operator_arity {
|
||||
IVY_OP_UNARY,
|
||||
IVY_OP_BINARY,
|
||||
};
|
||||
|
||||
enum ivy_operator_id {
|
||||
IVY_OP_NONE = 0,
|
||||
IVY_OP_ASSIGN,
|
||||
@@ -66,6 +77,7 @@ enum ivy_operator_id {
|
||||
IVY_OP_UNDERSTANDS,
|
||||
IVY_OP_SELF_ACCESS,
|
||||
IVY_OP_PKG_ACCESS,
|
||||
IVY_OP_MSG,
|
||||
};
|
||||
|
||||
struct ivy_operator {
|
||||
@@ -73,6 +85,8 @@ struct ivy_operator {
|
||||
unsigned int op_token;
|
||||
enum ivy_operator_precedence op_precedence;
|
||||
enum ivy_operator_associativity op_associativity;
|
||||
enum ivy_operator_location op_location;
|
||||
enum ivy_operator_arity op_arity;
|
||||
};
|
||||
|
||||
IVY_API const struct ivy_operator *ivy_operator_get(unsigned int token);
|
||||
|
||||
Reference in New Issue
Block a user