|
|
|
@ -18,7 +18,8 @@ use thiserror::Error;
|
|
|
|
|
use crate::data::expr::{get_op, Bytecode, Expr, NoImplementationError};
|
|
|
|
|
use crate::data::functions::{
|
|
|
|
|
OP_ADD, OP_AND, OP_COALESCE, OP_CONCAT, OP_DIV, OP_EQ, OP_GE, OP_GT, OP_JSON_OBJECT, OP_LE,
|
|
|
|
|
OP_LIST, OP_LT, OP_MINUS, OP_MOD, OP_MUL, OP_NEGATE, OP_NEQ, OP_OR, OP_POW, OP_SUB,
|
|
|
|
|
OP_LIST, OP_LT, OP_MAYBE_GET, OP_MINUS, OP_MOD, OP_MUL, OP_NEGATE, OP_NEQ, OP_OR, OP_POW,
|
|
|
|
|
OP_SUB,
|
|
|
|
|
};
|
|
|
|
|
use crate::data::symb::Symbol;
|
|
|
|
|
use crate::data::value::DataValue;
|
|
|
|
@ -45,6 +46,7 @@ lazy_static! {
|
|
|
|
|
.op(Op::infix(Rule::op_coalesce, Left))
|
|
|
|
|
.op(Op::prefix(Rule::minus))
|
|
|
|
|
.op(Op::prefix(Rule::negate))
|
|
|
|
|
.op(Op::infix(Rule::op_field_access, Left))
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -160,6 +162,7 @@ fn build_expr_infix(lhs: Result<Expr>, op: Pair<'_>, rhs: Result<Expr>) -> Resul
|
|
|
|
|
Rule::op_or => &OP_OR,
|
|
|
|
|
Rule::op_and => &OP_AND,
|
|
|
|
|
Rule::op_coalesce => &OP_COALESCE,
|
|
|
|
|
Rule::op_field_access => &OP_MAYBE_GET,
|
|
|
|
|
_ => unreachable!(),
|
|
|
|
|
};
|
|
|
|
|
let start = args[0].span().0;
|
|
|
|
|