Function linkspace::abe::lk_eval_loose

source ·
pub fn lk_eval_loose<'o>(
    expr: &str,
    udata: impl Into<UserData<'o>>
) -> LkResult<Vec<u8>>
Expand description

Same as lk_eval but accepts bytes outside the range 0x20..0xfe as-is. useful for templating with newlines and utf bytes.

This distinction exists because UTF has a bunch of characters that can hide a surprise - lk_eval input and lk_encode output is only ever ascii.

assert_eq!( "abc 🔗🔗".as_bytes() as &[u8], &lk_eval_loose( "abc 🔗🔗" ,())?, );
assert_eq!( "\0\0\0\0\0\0\0\0\0\0\0\0🔗 4036990103".as_bytes() as &[u8], &lk_eval_loose( "[a:🔗] [:🔗/?u]",())?, );