DUX-5350 Don't eval modules with no eval commands#458
Merged
Conversation
In #454 I restructured the eval command logic. Before, the loop looked like this: ```rust for (path, commands) in eval_commands_by_path { for command in commands { do_eval_command(command); } } ``` After, I pulled some logic out of the inner loop: ```rust for (path, commands) in eval_commands_by_path { do_common_logic(path); for command in commands { do_eval_command(command); } finish_common_logic(path); } ``` But sometimes `commands` was empty, doing unnecessary work in the best case and attempting to eval non-Haskell in the worst case! Let's skip empty entries.
2 tasks
parsonsmatt
approved these changes
Jun 15, 2026
9999years
added a commit
that referenced
this pull request
Jun 15, 2026
To actually _execute_ eval commands with the proper bindings in scope, we need to be able to evaluate (interpret) a file, which requires we know its module _name_ (because `:module + *MODULE_NAME` only supports module names and not source paths). Let's guard adding an entry to the `eval_commands` map by making sure we can convert the path to a module name. See also: #458, #454. - [ ] Updated the user manual in `docs/`. - [x] Added integration / regression tests in `tests/`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #454 I restructured the eval command logic.
Before, the loop looked like this:
After, I pulled some logic out of the inner loop:
But sometimes
commandswas empty, doing unnecessary work in the best case and attempting to eval non-Haskell in the worst case!Let's skip empty entries.
docs/.tests/.