refactor: split builtin printf/macros and relocate highlight module - #3
Merged
Merged
Conversation
…ghlight module Extracts printf parsing/formatting and shared builtin macros out of builtin-commands.lisp into dedicated files, moves highlight support from src/presentation/ to a top-level src/highlight.lisp + package-highlight.lisp, and threads shell-context through the process-substitution and background-job process adapters (spawn-async, spawn-pipeline-async, process-pid, process-substitution-resource-fd/path, release/wait/close) for consistency with the existing %process-fn adapter pattern. Fixes two accidental regressions found while restoring test coverage: the %process-fn/%optional-process-fn adapters had been dropped from builtin-runtime.lisp, and %seq-parse-args leaked a raw condition object as a fourth return value. Declares the process-substitution-resource accessor wrappers notinline, since SBCL inlines defstruct accessors by default and an inlined call bypasses WITH-TEMPORARY-FUNCTION's mock in tests. Updates test fixtures and call sites for the new context-threaded signatures.
…intf-and-highlight-module # Conflicts: # run-tests.lisp # scripts/weave.lisp
This was referenced Aug 19, 2026
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.
Summary
builtin-commands.lispinto dedicated files (builtin-printf*.lisp,builtin-macros.lisp).src/presentation/to a top-levelsrc/highlight.lisp+src/package-highlight.lisp.shell-contextthrough the process-substitution and background-job process adapters (spawn-async,spawn-pipeline-async,process-pid,process-substitution-resource-fd/-path, release/wait/close), consistent with the existing%process-fnadapter pattern.Fixes found while restoring test coverage
%process-fn/%optional-process-fnhad been accidentally dropped frombuiltin-runtime.lispduring the split, breaking every builtin that runs an external command.%seq-parse-argsleaked a raw condition object as a 4th return value on parse failure, breaking its documented single-value error contract.process-substitution-resource-fd/-patharedefstructaccessors, which SBCL inlines by default; the new adapter wrappers now declare themnotinlinesowith-temporary-functionmocks in tests actually take effect.make-test-builtins-context,make-test-shell-contextusers) and call sites for the new context-threaded signatures.Test plan
nix run .#test— 1587 passed, 0 failed, 0 errored (exit 0), run against a freshNSHELL_ASDF_OUTPUT_DIRafter merging currentmain.