Skip to content

Commit

Permalink
use the .info() for nicall
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthz committed Jan 28, 2024
1 parent 4dd97bf commit 77872bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions werbolg-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use werbolg_compile::{compile as comp, CallArity, CompilationError, Environment}
use werbolg_core::Literal;
use werbolg_core::{AbsPath, Ident, Namespace, Span};
use werbolg_exec::{
ExecutionEnviron, ExecutionError, ExecutionMachine, ExecutionParams, NIFCall, WAllocator, NIF,
ExecutionEnviron, ExecutionError, ExecutionMachine, ExecutionParams, NIFCall, WAllocator,
};

pub struct DummyAlloc;
Expand Down Expand Up @@ -83,11 +83,7 @@ fn literal_mapper(span: Span, lit: Literal) -> Result<MyLiteral, CompilationErro
pub fn execute(mod1: werbolg_core::Module) -> Result<Value, ExecutionError> {
macro_rules! add_pure_nif {
($env:ident, $i:literal, $arity:literal, $e:expr) => {
let nif = NIF {
name: $i,
arity: CallArity::try_from($arity as usize).unwrap(),
call: NIFCall::Pure($e),
};
let nif = NIFCall::Pure($e).info($i, CallArity::try_from($arity as usize).unwrap());
let path = AbsPath::new(&Namespace::root(), &Ident::from($i));
$env.add_nif(&path, nif);
};
Expand Down

0 comments on commit 77872bf

Please sign in to comment.