DEV: NotEqual and other comparisons fixes.

This commit is contained in:
Jeremy Wall 2019-07-29 18:32:45 -05:00
parent 059c336990
commit badf370dfb
2 changed files with 7 additions and 1 deletions

View File

@ -550,6 +550,12 @@ fn simple_binary_expr() {
"6/2;" => P(Int(3)),
"1.0+1.0;" => P(Float(2.0)),
"\"foo\"+\"bar\";" => P(Str("foobar".to_owned())),
"1==1;" => P(Bool(true)),
"1>1;" => P(Bool(false)),
"1<1;" => P(Bool(false)),
"2>1;" => P(Bool(true)),
"2<1;" => P(Bool(false)),
"1!=1;" => P(Bool(false)),
//"true && false;" => P(Bool(false)),
)
}

View File

@ -79,8 +79,8 @@ impl AST {
unimplemented!("Binary expressions are not implmented yet")
}
BinaryExprType::NotEqual => {
ops.push(Op::Not);
ops.push(Op::Equal);
ops.push(Op::Not);
}
BinaryExprType::REMatch
| BinaryExprType::NotREMatch