add support for comparison operators.

This commit is contained in:
Mark Thom
2017-12-03 17:44:51 -07:00
parent db38f091a8
commit 7b569becbe
9 changed files with 158 additions and 35 deletions

View File

@@ -16,15 +16,15 @@ macro_rules! deallocate {
)
}
macro_rules! query {
[$($x:expr),+] => (
Line::Query(vec![$($x),+])
macro_rules! move_at {
($at:expr, $r:expr) => (
Line::Query(vec![QueryInstruction::MoveArithmeticTerm($at, $r)])
)
}
macro_rules! arith {
($x:expr) => (
Line::Arithmetic($x)
macro_rules! query {
[$($x:expr),+] => (
Line::Query(vec![$($x),+])
)
}
@@ -50,6 +50,12 @@ macro_rules! fact {
)
}
macro_rules! compare_number_call {
($cmp: expr) => (
Line::Control(ControlInstruction::CompareNumberCall($cmp))
)
}
macro_rules! temp_v {
($x:expr) => (
RegType::Temp($x)
@@ -105,12 +111,6 @@ macro_rules! put_unsafe_value {
)
}
macro_rules! add {
($r1:expr, $r2:expr, $t:expr) => (
ArithmeticInstruction::Add($r1, $r2, $t)
)
}
macro_rules! try_me_else {
($o:expr) => (
Line::Choice(ChoiceInstruction::TryMeElse($o))