Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When building or checking a source file, the compiler derives its name based on the file path. If the file is located outside of the project's root, the name defaults to "main". This commit improves this logic by adding an extra fallback _before_ falling back to "main". This extra fallback scans the file path for a "src" directory and uses everything _after_ that to derive a module name from. This makes it possible to type-check files from projects in sub directories. For example, with this change you can run `inko check ./libstd/src/std/string.inko` from the `.` directory, instead of having to `cd` into `libstd` first. Prior to this commit this could lead to errors, as the compiler wouldn't correctly detect standard library files as being part of the standard library, thus disallowing the use of `_INKO.x` expressions. Changelog: changed
- Loading branch information