1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#![feature(unboxed_closures)]

extern crate libc;

macro_rules! assert_enum {
    (@as_expr $e:expr) => {$e};
    (@as_pat $p:pat) => {$p};
    ($left:expr, $($right:tt)*) => (
        {
            match &($left) {
                assert_enum!(@as_pat &$($right)*(..)) => {},
                _ => {
                    panic!("assertion failed: `(if let left = right(..))` \
                           (left: `{:?}`, right: `{:?}`)",
                           $left,
                           stringify!($($right)*)
                           )
                }
            }
        }
    )
}

pub mod ffi;
pub mod stack;

pub mod collections;

mod context;
mod value;
mod borrow;
mod function;

pub use context::*;
pub use collections::*;
pub use value::*;
pub use borrow::*;
pub use function::*;

pub struct nil;

#[macro_export]
macro_rules! push {
    ($cxt:expr, $($arg:expr),*) => (
        $(
            $cxt.push($arg);
        )*
    )
}