From fd3a641c718e45f9dc13dc0b90c0bd2541966bca Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 14 Oct 2021 06:33:47 -0700 Subject: [PATCH] Fix quick_ast --- schala-lang/language/src/util.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/schala-lang/language/src/util.rs b/schala-lang/language/src/util.rs index 80abf2d..855c87a 100644 --- a/schala-lang/language/src/util.rs +++ b/schala-lang/language/src/util.rs @@ -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 -#[allow(dead_code)] +/// Quickly create an AST from a string, with no error checking. For test use only +#[cfg(test)] pub fn quick_ast(input: &str) -> crate::ast::AST { let tokens = crate::tokenizing::tokenize(input); let mut parser = crate::parsing::Parser::new(); parser.add_new_tokens(tokens); let output = parser.parse(); - std::mem::drop(parser); output.unwrap() }