Skip to content

Introduce crate keyword for local imports #294

@LesterEvSe

Description

@LesterEvSe

Project

driver

Describe the feature

Currently, the compiler processes all dependencies through the --dep flag without distinguishing between local files and external libraries. So it would be better to introduce crate keyword to explicitly mark local program files, separating them from external dependencies.

Motivation

  • Prevents a breaking change in future versions. Adding this distinction later would require rewriting all existing import paths.
  • Improves error reporting. It would be easier for the error handler to tell whether an unresolved path is a missing local file or a missing external dependency.
  • Improves code readability. For example, crate::utils::foo immediately signals local code, while mathlib::utils::foo signals an external library.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions