source-academy / js-slang

Implementations of sublanguages of JavaScript, TypeScript, Scheme and Python
https://source-academy.github.io/source/
Apache License 2.0
66 stars 104 forks source link

1401 add support for local module importexport to source typed #1686

Closed ZweZeya closed 5 months ago

ZweZeya commented 5 months ago

I updated TypedES to make it compatible with updated @types/estree so that Typed AST is a supertype of non-typed AST. To update non-typed AST, run yarn add -D @types/estree. I also added additional conditional statements to enable local import and export syntax to be used in Source Typed in folders mode. However, the typechecking of local imports and exports may require additional work and this is just a partial fix to https://github.com/source-academy/js-slang/issues/1401. To fully make this functional, we have to enable preprocessor to take in Typed AST instead of non-typed AST which I have changed. However, we have to look into the helper functions as well because the preprocessor has many helper functions and they all take in non-Typed AST. Currently, I am typecasting to get around this issue.

s-kybound commented 5 months ago

Hi, the PR seems to have a lot of merge conflicts at the moment - please resolve them!

RichDom2185 commented 5 months ago

Hi, the PR seems to have a lot of merge conflicts at the moment - please resolve them!

They are not merge conflicts; seems to be an incorrect merge resolution in the past. Will have to manually check using an interactive rebase. I'll handle it.

RichDom2185 commented 5 months ago

Hi, the PR seems to have a lot of merge conflicts at the moment - please resolve them!

They are not merge conflicts; seems to be an incorrect merge resolution in the past. Will have to manually check using an interactive rebase. I'll handle it.

Update: seems like the submodules for this branch are also a bit whack; I'll just generate a patch and squash everything.

RichDom2185 commented 5 months ago

Resolution steps (for review by @s-kybound and also cross-check @ZweZeya):

git log --pretty=format:"%h" @..master | pbcopy
echo "$(pbpaste)" | while read line; do echo "$line" "$(git diff "$line"..@ | wc -l)"; done

Output:

a5b6f47f    21771
9819f2c0    21728
60d3de20    21728
83a81539    18758
294be200    18758
bbfcf01a    18744
44a616e8    18744
ce94ea0c    18450
78c4f261    18447
ecd5955c    16249
44491276    15711
383248fd    15698
eaddfe3a    15698
ea7aee98    15699
3fccd1c9    14894
5d5f1f39    14269
640b36cf    14245
56c65628    14232
1dfa9f58    14215
68bc562f    14201
d6c33684    14188
5a47d62d    14170
12367c1f    14156
8fc02a79    14044
dfce1103    13532
ff68bb59     6244
37329c2d     4090
1692d26b     4045
dae15c60      227
120874ec      238
8351b68a      246
8747fd53     5428
4b7aed10     5509
cffe0e70     5536
93f17a1e     5552
9f9a4c41     5545
b7a331cf     5575
db0a985f     5575
a2098a0b     5583
816058e1     5576
8aa08d51     5590
e1637fef     6345
8486835e     6757
0dd25175     6805
cd3bbc38     6818

Found the commit with the least difference to the code (just intuition/arbitraty heuristic) – dae15c60

Then did an interactive rebase on top of that and finally merged back master properly.

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 8857450010

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/typeChecker/typeErrorChecker.ts 0 1 0.0%
<!-- Total: 1 2 50.0% -->
Totals Coverage Status
Change from base Build 8857447014: -0.009%
Covered Lines: 10917
Relevant Lines: 12953

💛 - Coveralls
martin-henz commented 5 months ago

Fixes @1404. New issue #1693 takes care of remaining tasks.