From fdae943090463526423f5e43e72cd2f0e8147a1b Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Mon, 4 Aug 2025 23:50:46 +0300 Subject: Added repl and some documentation. Improved error messages. Removed dead code. * Removed same_variant in parse::parsetree * Added SExp::multistep (for use of the repl) Improved error messages: * Added parenthesis around types * Changed how errors propagate inferring generics: added the error variant ArgumentsDontMatchGeneric, implemented the displaying of it, added tests for it. * Had to change some tests to match for the new changes --- src/parse/parsetree.rs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/parse/parsetree.rs') diff --git a/src/parse/parsetree.rs b/src/parse/parsetree.rs index 7e1c80d..5507b0b 100644 --- a/src/parse/parsetree.rs +++ b/src/parse/parsetree.rs @@ -21,19 +21,6 @@ pub enum Token { Whitespace(String), } -impl Token { - fn same_variant(&self, other: Token) -> bool { - match (self, other) { - (ParOpen, ParOpen) => true, - (ParClose, ParClose) => true, - (Num(_), Num(_)) => true, - (Sym(_), Sym(_)) => true, - (Whitespace(_), Whitespace(_)) => true, - _ => false - } - } -} - use std::fmt; use std::fmt::Display; impl Display for Token { @@ -88,8 +75,6 @@ fn tokens_to_ast_inner( mut input: VecDeque ) -> Result<(Vec, SExp), String> { - println!("{:?}", input.clone()); - let mut current_token = input.pop_front(); match current_token { -- cgit v1.2.3