nilang 0.4.1

A scripting language interpreter for Advent of Code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use sandpit::{Mutator, Trace, Tracer};

use super::error::RuntimeError;
use super::value::Value;

pub type NativeFn = for<'gc> fn(&[Value<'gc>], &'gc Mutator<'gc>) -> Result<Value<'gc>, RuntimeError>;

#[derive(Clone, Copy)]
pub struct NativeFunc {
    pub arity: u8,
    pub func: NativeFn,
}

unsafe impl Trace for NativeFunc {
    const IS_LEAF: bool = true;

    fn trace(&self, _: &mut Tracer) {}
}