pca006132
f97f93d92c
applied rustfmt and clippy auto fix
2022-02-21 18:27:46 +08:00
pca006132
d9cb506f6a
nac3core: refactored for better error messages
2022-02-21 18:24:19 +08:00
Sebastien Bourdeauducq
142f82f987
remove debug prints
2021-12-01 22:48:06 +08:00
ychenfo
49476d06e1
nac3core: clearer comments
2021-11-22 15:06:16 +08:00
ychenfo
c2706fa720
nac3core: fix polymorphic class method partial instantiation
2021-11-21 06:11:55 +08:00
Sebastien Bourdeauducq
96607432c1
nac3core: use Python 3.9 list/tuple annotations in test
...
Closes #85
2021-11-11 20:05:08 +08:00
pca006132
b1e83a1fd4
nac3core: type check invariants
...
This rejects code that tries to assign to KernelInvariant fields and
methods.
2021-11-06 22:48:08 +08:00
pca006132
8dbb4ad58a
nac3core/toplevel: make test less fragile
...
test results should not depend on internal states if possible
2021-11-05 20:28:21 +08:00
Sebastien Bourdeauducq
bf7e2c295a
integrate nac3parser
2021-11-03 17:11:00 +08:00
pca006132
279f47f633
nac3core/codegen: avoid sending unifiers
...
Previously, we have to copy types from one unification table to another,
and make the table sendable. This requires cloning (processing) the
whole table 3 times per function call which is not efficient and uses
more memory than required when the unification table is large.
We now use a concrete type table to only copy the type we need. This
reduces the overhead as we only need to process the unification table
for once (when we do the function codegen), and reduces memory usage by
a bit (but not noticeable when the unification table is small, i.e. the
types are simple).
2021-10-17 13:02:18 +08:00
pca006132
26076c37ba
nac3core/typecheck: supports recursive type inference
2021-10-16 15:56:49 +08:00
pca006132
105d605e6d
nac3core: fix clippy warnings
2021-09-22 18:04:06 +08:00
pca006132
97f5b7c324
fixed performance regression
2021-09-22 18:04:06 +08:00
pca006132
084efe92af
nac3core: use string interning
2021-09-22 18:04:06 +08:00
ychenfo
dd1be541b8
nac3core: allow class to have no __init__, function/method name with module path added to ensure uniqueness
2021-09-20 23:36:19 +08:00
pca006132
180392e2ab
typecheck: fixed recursive substitution
2021-09-12 21:33:21 +08:00
ychenfo
471547855e
nac3core: toplevel change class method name handling, cleanup comments
2021-09-12 13:14:46 +08:00
ychenfo
917d447605
nac3core: clean up, fix broken test
2021-09-09 02:09:35 +08:00
ychenfo
f1013d9a17
nac3core: top level fix type var within list tuple, test of type var application compatibility
2021-09-09 02:03:44 +08:00
ychenfo
235b6e34d1
nac3core: top level derive fmt::Debug, fix dead lock
2021-09-07 00:20:40 +08:00
pca006132
173102fc56
codegen/expr: function codegen and refactoring
2021-08-25 15:29:58 +08:00
pca006132
1ffa1a8bb0
typecheck/typedef: added copy_from
...
This function would copy concrete type from one unifier to another
unifier, and can handle recursive types. This would be used in code
generation for moving types from one unification table to another one.
2021-08-25 12:02:10 +08:00
ychenfo
32773c14e0
move top level related things to a separate module
2021-08-24 17:19:17 +08:00
ychenfo
7b1fe36e90
formatted
2021-08-23 11:13:45 +08:00
ychenfo
fb5b4697a9
fix rebase conflict and some test failure with unifier's error message
2021-08-23 10:34:11 +08:00
pca006132
957ceb74e4
nac3core/typecheck: added basic location information
2021-08-21 14:51:46 +08:00
pca006132
3279f7a776
codegen for simple function call, and various fixes
2021-08-19 15:30:15 +08:00
ychenfo
fa40fd73c6
formatted
2021-08-16 20:17:08 +08:00
ychenfo
eb814dd8c3
clean unused use
2021-08-16 13:57:21 +08:00
ychenfo
3734663188
add RefCell to FunSignature in TypeEnum
2021-08-16 13:53:45 +08:00
pca006132
cb01c79603
removed Arc from TypeEnum
2021-08-13 13:33:59 +08:00
pca006132
1db8378f60
formatting
2021-08-12 16:36:23 +08:00
ychenfo
3a93e2b048
TypeEnum::TObj.param is now RefCell for interior mutability
2021-08-12 13:17:51 +08:00
pca006132
de8b67b605
refactored symbol resolver
2021-08-11 17:28:29 +08:00
pca006132
86ca02796b
function parameter handling
2021-08-07 17:25:14 +08:00
pca006132
7a38ab3119
codegen for function call
2021-08-07 15:06:39 +08:00
ychenfo
18db2ddd53
change the type TypeEnum::TObj {object_id} to DefinitionId as with top_level
...
change TopLevelDef::Class {object_id} to DefinitionId
2021-08-06 10:57:01 +08:00
pca006132
29286210b5
implementing codegen
2021-08-05 14:56:09 +08:00
pca006132
f00c1813e3
top-level related changes
2021-08-03 13:38:27 +08:00
pca006132
a3acf09bda
typedef: make it send
...
Rc in calls is not send, so we use Arc instead.
2021-08-03 12:38:12 +08:00
CrescentonC
d4721db4a3
not creating temp for borrow, more concise code
2021-08-03 09:45:39 +08:00
CrescentonC
a7e3eeea0d
add primitive magic method support; change from TypeEnum::TObj { fields: Mapping<String>, ..} to TypeEnum::TObj {fields: RefCell<Mapping<String>>, .. } for interior mutability
2021-08-02 17:36:37 +08:00
pca006132
197a72c658
added comment
2021-07-30 16:43:25 +08:00
pca006132
eba92ed8bd
added method to get all instantiations
2021-07-30 16:32:50 +08:00
pca006132
7ad8e2d81d
cleanup some error reporting code
2021-07-30 13:50:46 +08:00
pca006132
743a9384a3
added rigid type variable
2021-07-30 11:28:27 +08:00
pca006132
832513e210
new is_concrete type check
2021-07-28 17:25:19 +08:00
pca006132
8d0856a58d
added documentation
2021-07-26 14:38:18 +08:00
pca006132
bf31c48bba
fixed missing unification
2021-07-26 14:20:47 +08:00
pca006132
8618837816
fixed range unification
2021-07-26 12:00:06 +08:00