WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 8 forks source link

Prevent wildcard import from doubling a previous named import #41

Closed w00tyd00d closed 9 months ago

w00tyd00d commented 11 months ago

Description

Right now using the wildcard import character (*) to import an entire folder, it doesn't take into consideration any possible files that have already been previously imported from within that folder.

It will cache the usage of that exact wildcard import to prevent it from being imported twice, same as if you were to name the specific module (wouldn't be imported twice if imported again) but when using them in tandem, the wildcard will still pull everything from a folder including any named files you've already imported.

It would be a really nice feature if the wildcard would be able to cross reference any previously imported files from the list of files its trying to import and prevent doubly importing any files that have already been loaded. The purpose of this feature is to be able to ensure a load order of the modules you need to load first without needing to isolate them from the rest of your source.