Skip to content

refactor: split builtin printf/macros and relocate highlight module - #3

Merged
takeokunn merged 2 commits into
mainfrom
feat/split-builtin-printf-and-highlight-module
Aug 19, 2026
Merged

refactor: split builtin printf/macros and relocate highlight module#3
takeokunn merged 2 commits into
mainfrom
feat/split-builtin-printf-and-highlight-module

Conversation

@takeokunn

Copy link
Copy Markdown
Collaborator

Summary

  • Extract printf parsing/formatting and shared builtin macros out of builtin-commands.lisp into dedicated files (builtin-printf*.lisp, builtin-macros.lisp).
  • Relocate highlight support from src/presentation/ to a top-level src/highlight.lisp + src/package-highlight.lisp.
  • Thread 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), consistent with the existing %process-fn adapter pattern.

Fixes found while restoring test coverage

  • %process-fn/%optional-process-fn had been accidentally dropped from builtin-runtime.lisp during the split, breaking every builtin that runs an external command.
  • %seq-parse-args leaked a raw condition object as a 4th return value on parse failure, breaking its documented single-value error contract.
  • process-substitution-resource-fd/-path are defstruct accessors, which SBCL inlines by default; the new adapter wrappers now declare them notinline so with-temporary-function mocks in tests actually take effect.
  • Updated test fixtures (make-test-builtins-context, make-test-shell-context users) 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 fresh NSHELL_ASDF_OUTPUT_DIR after merging current main.

…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
@takeokunn
takeokunn merged commit 7e4a9a2 into main Aug 19, 2026
2 of 8 checks passed
@takeokunn
takeokunn deleted the feat/split-builtin-printf-and-highlight-module branch August 19, 2026 22:59
takeokunn added a commit that referenced this pull request Aug 19, 2026
revert: undo PR #3/#4 pending CI-only e2e-main-help regression investigation
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.

1 participant