add provisions for arithmetic support.

This commit is contained in:
Mark Thom
2017-11-05 17:12:30 -07:00
parent a70c100e0d
commit 5568d0b370
15 changed files with 792 additions and 118 deletions

View File

@@ -22,6 +22,12 @@ macro_rules! query {
)
}
macro_rules! string {
($str:expr) => {
vec![HeapCellValue::Con(Constant::String(String::from($str)))]
}
}
macro_rules! functor {
($name:expr, $len:expr, [$($args:expr),*]) => {{
if $len > 0 {
@@ -81,6 +87,12 @@ macro_rules! put_var {
)
}
macro_rules! put_constant {
($lvl:expr, $cons:expr, $r:expr) => (
QueryInstruction::PutConstant($lvl, $cons, $r)
)
}
macro_rules! put_value {
($r:expr, $arg:expr) => (
QueryInstruction::PutValue($r, $arg)
@@ -197,6 +209,12 @@ macro_rules! unify {
)
}
macro_rules! unify_call {
() => (
Line::Control(ControlInstruction::UnifyCall)
)
}
macro_rules! unwind_stack {
() => (
Line::BuiltIn(BuiltInInstruction::UnwindStack)