Added super-janky prelude capability
This commit is contained in:
parent
ff5446af3f
commit
25790f8643
@ -40,7 +40,7 @@ pub struct Schala {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Schala {
|
impl Schala {
|
||||||
pub fn new() -> Schala {
|
fn new_blank_env() -> Schala {
|
||||||
let symbols = Rc::new(RefCell::new(symbol_table::SymbolTable::new()));
|
let symbols = Rc::new(RefCell::new(symbol_table::SymbolTable::new()));
|
||||||
Schala {
|
Schala {
|
||||||
symbol_table: symbols.clone(),
|
symbol_table: symbols.clone(),
|
||||||
@ -48,6 +48,15 @@ impl Schala {
|
|||||||
state: eval::State::new(symbols),
|
state: eval::State::new(symbols),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new() -> Schala {
|
||||||
|
let prelude = r#"
|
||||||
|
type Option<T> = Some(T) | None
|
||||||
|
"#;
|
||||||
|
let mut s = Schala::new_blank_env();
|
||||||
|
s.execute_pipeline(prelude, &EvalOptions::default());
|
||||||
|
s
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tokenizing(_handle: &mut Schala, input: &str, comp: Option<&mut UnfinishedComputation>) -> Result<Vec<tokenizing::Token>, String> {
|
fn tokenizing(_handle: &mut Schala, input: &str, comp: Option<&mut UnfinishedComputation>) -> Result<Vec<tokenizing::Token>, String> {
|
||||||
|
Loading…
Reference in New Issue
Block a user