nim-works / nimskull

An in development statically typed systems programming language; with sustainability at its core. We, the community of users, maintain it.
https://nim-works.github.io/nimskull/index.html
Other
279 stars 39 forks source link

fix: import current dir relative modules #1432

Closed saem closed 3 months ago

saem commented 3 months ago

Summary

Attempts to import modules using relative import with multiple module syntax like import ./[foo, bar] no longer result in an error.

Fixes: https://github.com/nim-works/nimskull/issues/1430

Details

./some_dir/[foo] worked because the AST resulted in an infix node for the second directory separator / , but a prefix node when using ./[foo] , importEval now takes this into account. A test has been included along with the fix.

Along with this change some preexisting import statement tests were adjusted away from using when false to flag known issues to the builtin testament functionality of the knownissue field.

saem commented 3 months ago

Yup, that code seems simpler

saem commented 3 months ago

/merge

github-actions[bot] commented 3 months ago

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below: