Skip to content

Make import keyword change working directory during external compilation#325

Merged
softmattertheory merged 2 commits into
Morpho-lang:devfrom
WoodchuckXL:iss277
Jul 20, 2026
Merged

Make import keyword change working directory during external compilation#325
softmattertheory merged 2 commits into
Morpho-lang:devfrom
WoodchuckXL:iss277

Conversation

@WoodchuckXL

Copy link
Copy Markdown

Fix for #277.
Changes the global CWD to the current file path during compilation of imported files to allow for them to import files with local paths. The CWD is restored after compilation of the imported file is finished.
Added test for this behavior.

@softmattertheory

softmattertheory commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This is a very useful fix; thanks for the great contribution! There's a macro MORPHO_DIRSEPARATOR that gives the folder separator that might be better to use than hard coded '/'.

@softmattertheory

Copy link
Copy Markdown
Contributor

Thanks for the great contribution, @WoodchuckXL!

@softmattertheory
softmattertheory merged commit ce009f2 into Morpho-lang:dev Jul 20, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants