Remove some no-longer-necessary indirection

This commit is contained in:
greg 2019-03-19 19:16:41 -07:00
parent 61972410ea
commit c767402865
1 changed files with 2 additions and 7 deletions

View File

@ -86,11 +86,6 @@ impl Schala {
}
}
fn load_source<'a>(input: &'a str, handle: &mut Schala) -> Result<&'a str, String> {
handle.source_reference.load_new_source(input);
Ok(input)
}
fn tokenizing(input: &str, _handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result<Vec<tokenizing::Token>, String> {
let tokens = tokenizing::tokenize(input);
comp.map(|comp| {
@ -236,8 +231,8 @@ impl ProgrammingLanguageInterface for Schala {
let mut reducing_debug_artifact = None;
let mut eval_debug_artifact = None;
load_source(&source, self);
let main_output: Result<String, String> = tokenizing(&source, self, token_debug_artifact)
self.source_reference.load_new_source(source);
let main_output: Result<String, String> = tokenizing(source, self, token_debug_artifact)
.and_then(|tokens| parsing(tokens, self, parsing_debug_artifact))
.and_then(|ast| symbol_table(ast, self, symbol_debug_artifact))
.and_then(|ast| typechecking(ast, self, typechecking_debug_artifact))