mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
DEV: NotEqual and other comparisons fixes.
This commit is contained in:
parent
059c336990
commit
badf370dfb
@ -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)),
|
||||
)
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user