fix arithmetic bugs.

This commit is contained in:
Mark Thom
2017-11-06 22:01:54 -07:00
parent 4624508fc1
commit 41d99938e7
6 changed files with 161 additions and 175 deletions

View File

@@ -22,6 +22,12 @@ macro_rules! query {
)
}
macro_rules! arith {
($x:expr) => (
Line::Arithmetic($x)
)
}
macro_rules! string {
($str:expr) => {
vec![HeapCellValue::Con(Constant::String(String::from($str)))]
@@ -105,6 +111,12 @@ 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))
@@ -209,9 +221,9 @@ macro_rules! unify {
)
}
macro_rules! unify_call {
() => (
Line::Control(ControlInstruction::UnifyCall)
macro_rules! is_call {
($r:expr) => (
Line::Control(ControlInstruction::IsCall($r))
)
}