aboutsummaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-04 23:50:46 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-04 23:50:46 +0300
commitfdae943090463526423f5e43e72cd2f0e8147a1b (patch)
tree5a7212555d8511df16fe6bbcc54b863ec9463b46 /src/parse
parent36d2818d39e61b752923e253f8455f50510cb428 (diff)
downloadmyslip-fdae943090463526423f5e43e72cd2f0e8147a1b.tar.gz
myslip-fdae943090463526423f5e43e72cd2f0e8147a1b.zip
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
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/parsetree.rs15
1 files changed, 0 insertions, 15 deletions
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<Token>
) -> Result<(Vec<Token>, SExp), String> {
- println!("{:?}", input.clone());
-
let mut current_token = input.pop_front();
match current_token {