Commit graph

60 commits

Author SHA1 Message Date
d81e92231f
Some minor enhancements
- Make if-elif-else possible
 - Add more tests
 - Ensure that failed tests fail tools like xargs
 - Refactor printing logic out of ConsoleDiagnostics
2023-06-11 11:04:04 +02:00
d278456290
Add experimental support for compiler annotations 2023-06-08 20:27:01 +02:00
c0c36ca698
Add the missing very basic evaluatator 2023-06-06 17:30:24 +02:00
abae39c791
Move all tests to test/ improve Checker tests 2023-06-06 17:28:56 +02:00
0326bbe7f9
Record variant constructors for future use 2023-06-05 15:53:24 +02:00
1147c751b9
Introduce new algorithm for better handling of recursive functions 2023-06-05 15:51:04 +02:00
1853612284
Add InferContext::add() 2023-06-05 14:45:13 +02:00
ebe1612112
Fix crash when using SourceFile.File when the reference no long exists 2023-06-05 12:16:54 +02:00
f63d892662
Re-introduce let declarations
Closes #42
2023-06-03 14:35:02 +02:00
73559460ec
Add a very simple evaluator for a subset of the language 2023-06-03 11:54:31 +02:00
4294063921
Simplify TArrow type as described in issue #42 2023-06-03 11:45:14 +02:00
6234a49feb
Rename Value to LiteralValue in CST.hpp 2023-06-02 20:58:03 +02:00
bf77031dd5
Add Checker::makeEqual between CEqual and Checker::addConstraint 2023-06-02 20:56:12 +02:00
ca2eb24da2
Remove unused CClass constraint 2023-06-02 20:55:27 +02:00
aede794e43
Keep track of errors in DiagnosticEngine 2023-06-02 16:28:05 +02:00
693301bac6
Improve support for type classes and simplify algorithm 2023-06-01 16:22:37 +02:00
a460b3b28a
Fix some bugs in print logic of CST nodes 2023-05-31 15:05:47 +02:00
25928c288b
Allow { and } on mupltiple lines with any indentation 2023-05-31 14:22:35 +02:00
b64b18216a
Second attemmpt at fixing critical bug in Node::unref() 2023-05-31 13:14:46 +02:00
717a2a663a
Some fixes and new pattern syntax
- Fix critical bug in deallocator
 - Add TuplePattern
 - Add ListPattern
 - Make Checker hold a ListType
2023-05-31 12:39:19 +02:00
fd462f6d05
Tidy up Checker.cc/Checker.hpp a bit 2023-05-30 23:11:41 +02:00
87af4686b7
Split let-declaration up into function/variable declarations 2023-05-30 21:34:40 +02:00
053d45868e
Rename Checker::pushContext() to Checker::setContext() 2023-05-30 17:00:15 +02:00
63547ee0a5
Fix some regressions due to previous commits 2023-05-30 15:27:21 +02:00
a8f8658f27
Make InferContext have a parent context 2023-05-30 13:37:47 +02:00
41aa820bca
Fix scope resolution 2023-05-30 13:35:26 +02:00
6bd8ecff39
Major update to code base
- Add partial support for extensible records
 - Rewrite unifier in Checker.cc
 - Make use of union/find instead of a HashMap for type variables
 - Enhance diagnostic messages
 - Add a variant type
 - Add application types (TApp)
 - Some smaller bugfixes
2023-05-29 20:37:23 +02:00
dfaa91c9b6
Add support for parsing more nodes and small fixes
- AppTypeExpression, NestedPattern, NamedPattern and VariantDeclaration
can now be parsed.
 - Fixed some memory leaks when a parse error is encountered
2023-05-28 21:49:32 +02:00
16e85f26bd
Add support for parsing record declarations 2023-05-27 15:25:17 +02:00
9afdd1e607
Make parser more forgiving 2023-05-26 19:51:12 +02:00
4acb76159f
Add CST definitions for record expressions and rename StructDeclaration 2023-05-26 15:36:14 +02:00
06127ff624
Improve checking recursive functions and some minor fixes 2023-05-26 14:30:50 +02:00
2448a70c76
Fix panic when trying to print tokens 2023-05-24 20:33:32 +02:00
04fffbe9aa
Refactor a bit and split header Diagnostics.hpp 2023-05-24 19:38:04 +02:00
6967f9a060
Sort diangostics by node and refactor ConsoleDiagnostics 2023-05-24 14:11:59 +02:00
5ac162cd72
Add support for nested/tuple type expressions 2023-05-23 22:36:01 +02:00
ebc51539ad
Remove support for 'pervious' environments 2023-05-23 21:32:23 +02:00
acbfeb8975
Fix type class constraint expressions not being correctly parsed 2023-05-23 20:04:41 +02:00
b23dc84f72
Fix variable declarations, fix regression due to eager solving, fix unification 2023-05-23 16:07:58 +02:00
302823ac9b
Split up Checker.hpp and make room for better type mismatch errors 2023-05-22 22:37:58 +02:00
508ef40bdf
Implement tuples and fix bug with type vars in infer/unify algorithm 2023-05-22 17:06:31 +02:00
bce5bffa85
Add support for parsing member expressions 2023-05-22 11:54:52 +02:00
4e27d778f0
Add some comments and lookup type class let declaration with Scope::lookupDirect() 2023-05-21 20:33:06 +02:00
093f307098
Fix instance declarations not being correctly typechecked 2023-05-21 20:14:41 +02:00
56cbfc6fbe
Add support for literal patterns 2023-05-21 17:36:44 +02:00
b6706dd801
Fix constructors like True and False not being parsed 2023-05-21 14:50:28 +02:00
1f94b7f799
Add support for match-expressions in parser 2023-05-21 11:30:25 +02:00
66d7b90f82
Clean up some code and introduce IdentifierAlt 2023-05-21 00:25:01 +02:00
db26fd3b18
Add experimental support for type classes and many more enhancements 2023-05-20 23:48:26 +02:00
a7fdc59440
Add missing Stream.hpp 2023-05-14 21:20:44 +02:00