Implement loading namespaces with the using keyword #829

Merged
ghallak merged 23 commits from ghallak/233 into master 2021-09-07 23:45:28 +09:00

23 Commits

Author SHA1 Message Date
Gaith Hallak
7fabbff11e Update the docs about the same alias for multiple namespaces 2021-09-06 17:53:25 +03:00
Gaith Hallak
c948591c86 Update the docs 2021-09-06 17:19:49 +03:00
Gaith Hallak
5725307643 Code cleaning 2021-09-06 17:18:52 +03:00
Gaith Hallak
fc55cfe059 Update CHANGELOG.md 2021-09-06 17:18:52 +03:00
Gaith Hallak
2d916733d8 Add tests for using namespace parts 2021-09-06 17:18:52 +03:00
Gaith Hallak
c29e9a7b2e Add using namespace parts to ast type inference 2021-09-06 17:18:52 +03:00
Gaith Hallak
81e4429585 Add using namespace parts to scanner and parser 2021-09-06 17:18:52 +03:00
Gaith Hallak
db60be0af3 Change the type of used_namespaces 2021-09-06 17:18:52 +03:00
Gaith Hallak
5ef068f1ff Add a test for using undefined namespaces 2021-09-06 17:18:52 +03:00
Gaith Hallak
9acd1b1d88 Forbid using undefined namespaces 2021-09-06 17:18:52 +03:00
Gaith Hallak
dfe0ad9c38 Split long line 2021-09-06 17:18:52 +03:00
Gaith Hallak
2a581a5800 Use a single using declaration 2021-09-06 17:18:52 +03:00
Gaith Hallak
21c16158ce Add test for wrong scope of using namespace 2021-09-06 17:18:52 +03:00
Gaith Hallak
c823c712ae Limit the scope of the used namespaces 2021-09-06 17:18:52 +03:00
Gaith Hallak
52b1c99ea7 Add failing test for ambiguous names 2021-09-06 17:18:52 +03:00
Gaith Hallak
8ac4156c87 Implement mk_error for ambiguous_name 2021-09-06 17:18:52 +03:00
Gaith Hallak
0782f439f5 Handle name collisions 2021-09-06 17:18:52 +03:00
Gaith Hallak
06dc68a7f2 Add a compiler test for using namespace 2021-09-06 17:18:52 +03:00
Gaith Hallak
976f6c42ba Allow using namespace to appear inside functions 2021-09-06 17:18:52 +03:00
Gaith Hallak
519e60039e Allow using namespace to appear in the top level 2021-09-06 17:18:52 +03:00
Gaith Hallak
3a4b63baa2 Add using namespace to AST type inference 2021-09-06 17:18:52 +03:00
Gaith Hallak
2d450397f4 Change the alias from id() to con() 2021-09-06 17:18:52 +03:00
Gaith Hallak
53ba62e423 Add using namespace as to scanner and parser 2021-09-06 17:18:52 +03:00