DEV: Not expressions compile

This commit is contained in:
Jeremy Wall 2019-07-29 18:37:24 -05:00
parent badf370dfb
commit c19a51424f
2 changed files with 12 additions and 1 deletions

View File

@ -559,3 +559,11 @@ fn simple_binary_expr() {
//"true && false;" => P(Bool(false)),
)
}
#[test]
fn simple_not_expr() {
assert_parse_cases!(
"not 1==1;" => P(Bool(false)),
"not 1!=1;" => P(Bool(true)),
)
}

View File

@ -105,7 +105,10 @@ impl AST {
Expression::Import(_) => unimplemented!("Import expressions are not implmented yet"),
Expression::Include(_) => unimplemented!("Include expressions are not implmented yet"),
Expression::Module(_) => unimplemented!("Module expressions are not implmented yet"),
Expression::Not(_) => unimplemented!("Not expressions are not implmented yet"),
Expression::Not(def) => {
Self::translate_expr(*def.expr, &mut ops);
ops.push(Op::Not);
}
Expression::Range(_) => unimplemented!("Range expressions are not implmented yet"),
Expression::Select(_) => unimplemented!("Select expressions are not implmented yet"),
Expression::Call(_) => unimplemented!("Call expressions are not implmented yet"),