aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-08-05Implemented booleans (no if-else yet)Joel Kronqvist
2025-08-05Added boilerplate and tests for booleans, integer comparisons and boolean ↵Joel Kronqvist
operators.
2025-08-05Changed project nameJoel Kronqvist
2025-08-04Added repl and some documentation. Improved error messages. Removed dead code.Joel Kronqvist
* 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
2025-08-04Implemented infer_type. Changed is_concrete tests and implemented it.Joel Kronqvist
Error messages still need improvement, maybe some new variants? is_concrete was changed to hold information on the first unbound variable through Result<(), String>.
2025-08-04Implemented generic substitution (tested) for use in inferring generics.Joel Kronqvist
2025-08-03Changed UndefinedType to VarType(String) for generics and added tests for ↵Joel Kronqvist
inferring them. Inferring is done by method Type::infer_generics. Whether it is executed is controlled by method Type::is_concrete. Also had to change the Display for Type and its tests, as the enum variants changed.
2025-08-03Implemented type_check, added method parts for SExpJoel Kronqvist
'parts' is different from 'into_vec', because it doesn't require flat structure and always succeeds
2025-08-02Added tests for type_check. Implemented std::fmt::Display for many enums. ↵Joel Kronqvist
Added type variants List(Type), and UndefinedType for use in error messages. Implemented type utility arr(a, b).
2025-08-01Added boilerplate for Type, TypeError and type_checkJoel Kronqvist
(small commit, had to sync between desktop and laptop)
2025-08-01Modified quote so the values of lists are evaluatedJoel Kronqvist
2025-07-31Added parse_to_ast for public use from other modulesJoel Kronqvist
2025-07-31Implemented tokens_to_ast. On second thought we should've just parsed the ↵Joel Kronqvist
code straight to ast without tokenization (implementing a parser on tokens was such a pain...)
2025-07-30Merge work done on laptop to desktop computerJoel Kronqvist
Merge branch 'devel' of ssh://cron4.fi/~/melisp into devel
2025-07-30Added tests for tokens_to_astJoel Kronqvist
2025-07-30Implemented evaluation according to tests. Quite a bit of changes were ↵Joel Kronqvist
required, see rest of commit message. SExp::Quote was added to let the interpreter know whether a list should be evaluated or treated as a literal list. It still needs code to be added for parsing it successfully. Some utility functions were needed: * SExp::is_value * SExp::consists_of_values * SExp::into_vec
2025-07-29Added Nil and modified tests to make this more of a list interpreter rather ↵Joel Kronqvist
than just a do-what-you-want-with-s-expressions thing
2025-07-27Implemented tokenize with tests - note it doesn't check syntaxJoel Kronqvist
2025-07-27Implemented parse_tokenJoel Kronqvist
2025-07-27Created parse_token and added tests for itJoel Kronqvist
2025-07-26Implemented substitutionJoel Kronqvist
2025-07-26Added variables and tests for their substitutionJoel Kronqvist
2025-07-26Implemented integer operator dynamics, fixed some tests and added a ↵Joel Kronqvist
combination test.
2025-07-26Created necessary data structures and utilities for integers and their ↵Joel Kronqvist
operations; added tests for them
2025-07-26Initialized project and added nom as dependencyJoel Kronqvist