ayaka-runtime 0.3.0

Ayaka low-level runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use anyhow::Result;
use ayaka_plugin::{Linker, RawModule};
use ayaka_script::Program;
use std::collections::HashMap;

pub fn register<M: RawModule>(store: &mut impl Linker<M>) -> Result<()> {
    let parse_func = store.wrap(|(program,): (String,)| program.parse::<Program>());
    store.import(
        "script",
        HashMap::from([("__parse".to_string(), parse_func)]),
    )?;
    Ok(())
}