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
mod lang;
use lang::{lang, _lua_data, _lua_str, _lua_call, _lua_lookup};
pub struct Lang (_lua_data);
pub struct LangValue (_lua_data);
impl Lang {
pub fn new() -> Self {
Lang(lang())
}
pub fn complex_parse(&self, x: &String) -> LangValue {
LangValue(_lua_call(_lua_lookup(self.0.clone(), _lua_str("complex_parse")), vec![_lua_str(&x.clone())]))
}
pub fn machinetext_parse(&self, x: &String) -> LangValue {
LangValue(_lua_call(_lua_lookup(self.0.clone(), _lua_str("complex_parse")), vec![_lua_str(&x.clone())]))
}
pub fn complex_print(&self, x: &LangValue) -> String {
_lua_call(_lua_lookup(self.0.clone(), _lua_str("complex_print")), vec![x.0.clone()]).as_string().clone()
}
pub fn machinetest_print(&self, x: &LangValue) -> String {
_lua_call(_lua_lookup(self.0.clone(), _lua_str("machinetest_print")), vec![x.0.clone()]).as_string().clone()
}
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}