add length, =.., more tests of builtins.

This commit is contained in:
Mark Thom
2018-01-27 15:37:59 -07:00
parent f939a9e129
commit 4f645b4664
7 changed files with 246 additions and 4 deletions

View File

@@ -96,6 +96,12 @@ macro_rules! get_value {
)
}
macro_rules! set_value {
($r:expr) => (
QueryInstruction::SetValue($r)
)
}
macro_rules! get_var_in_fact {
($r:expr, $arg:expr) => (
FactInstruction::GetVariable($r, $arg)
@@ -216,6 +222,12 @@ macro_rules! install_new_block {
)
}
macro_rules! goto_call {
($line:expr, $arity:expr) => (
Line::Control(ControlInstruction::GotoCall($line, $arity))
)
}
macro_rules! goto_execute {
($line:expr, $arity:expr) => (
Line::Control(ControlInstruction::GotoExecute($line, $arity))
@@ -346,6 +358,24 @@ macro_rules! functor_execute {
)
}
macro_rules! arg_execute {
() => (
Line::Control(ControlInstruction::ArgExecute)
)
}
macro_rules! arg_call {
() => (
Line::Control(ControlInstruction::ArgCall)
)
}
macro_rules! unify_value {
($r:expr) => (
FactInstruction::UnifyValue($r)
)
}
macro_rules! unify_variable {
($r:expr) => (
FactInstruction::UnifyVariable($r)
@@ -465,3 +495,15 @@ macro_rules! jmp_call {
Line::Control(ControlInstruction::JmpByCall($arity, $offset))
)
}
macro_rules! get_list {
($lvl:expr, $r:expr) => (
FactInstruction::GetList($lvl, $r)
)
}
macro_rules! unify_constant {
($c:expr) => (
FactInstruction::UnifyConstant($c)
)
}