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

@@ -131,6 +131,8 @@ impl fmt::Display for ControlInstruction {
write!(f, "deallocate"),
&ControlInstruction::Execute(ref name, arity) =>
write!(f, "execute {}/{}", name, arity),
&ControlInstruction::GotoCall(p, arity) =>
write!(f, "goto_call {}/{}", p, arity),
&ControlInstruction::GotoExecute(p, arity) =>
write!(f, "goto_execute {}/{}", p, arity),
&ControlInstruction::IsCall(r, ref at) =>
@@ -469,6 +471,8 @@ pub fn compile<'a, 'b: 'a>(wam: &'a mut Machine, tl: &'b TopLevelPacket) -> Eval
return EvalSession::from(e);
};
print_code(&code);
if !code.is_empty() {
if let Some(name) = tl.name() {
wam.add_user_code(name, tl.arity(), code)