Compare commits

...

2 Commits

Author SHA1 Message Date
Greg Shuflin
fd3a641c71 Fix quick_ast 2021-10-14 06:34:33 -07:00
Greg Shuflin
be8633fedb Rename symbol_table 2021-10-14 06:31:52 -07:00
2 changed files with 2 additions and 3 deletions

View File

@ -46,14 +46,13 @@ impl<'a, T, V> ScopeStack<'a, T, V> where T: Hash + Eq {
} }
} }
/// this is intended for use in tests, and does no error-handling whatsoever /// Quickly create an AST from a string, with no error checking. For test use only
#[allow(dead_code)] #[cfg(test)]
pub fn quick_ast(input: &str) -> crate::ast::AST { pub fn quick_ast(input: &str) -> crate::ast::AST {
let tokens = crate::tokenizing::tokenize(input); let tokens = crate::tokenizing::tokenize(input);
let mut parser = crate::parsing::Parser::new(); let mut parser = crate::parsing::Parser::new();
parser.add_new_tokens(tokens); parser.add_new_tokens(tokens);
let output = parser.parse(); let output = parser.parse();
std::mem::drop(parser);
output.unwrap() output.unwrap()
} }