Skip to content

Split the Walker (refactor 3.2, S5) - #240

Merged
sf624 merged 1 commit into
mainfrom
refactor/3.2-split
Oct 23, 2026
Merged

sf624 merged 1 commit into
mainfrom
refactor/3.2-split

Conversation

@sf624

@sf624 sf624 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Step 3.2 of docs/design/refactor.md, layer 1 of 3 (stack: #240 → #241 → #242).

Addresses: S5 (the split; the reuse key and opaque are in #241)

  • S5: Walker (state.ts, ~2,700 lines) is split into src/semantics/walk/: walker.ts (the walk: units, statements, jumps, loops, calls, substitutions), arith.ts (the walk's arithmetic), conditions.ts (statuses, [ ]/[[ ]]/case, decisions), builtins.ts (builtin effects and assignments), aliases.ts (alias commands and expansion), shared.ts (errors, Operand, the text parser). The state and its merge move to src/semantics/shellstate.ts (re-exported by state.ts); state.ts keeps the model (shellState, Scripts, childModel).

Pure move, no change of behaviour: the whole suite, every probe test, test/decisions.test.ts and the dumps of every fixture (sample.sh, coverage.sh, posix.sh, ksh.ksh, hosts/*) are unchanged. Node 24 coverage 100%, snippets check clean. Walk time unchanged (bundled bench, noise-level).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Web preview removed: the pull request is closed.

…ts and aliases (refactor 3.2, S5)

src/semantics/state.ts keeps the model (shellState, the strings it reads,
childModel); the state it carries and how states merge move to
src/semantics/shellstate.ts; the walk to src/semantics/walk/: walker.ts (the
statements, jumps, loops, calls), arith.ts, conditions.ts, builtins.ts (what
builtins and assignments change) and aliases.ts (the alias commands, and a
command run through an alias). No change of behaviour: every test, the
fixture dumps and the probes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sf624
sf624 force-pushed the refactor/3.2-split branch from 0a400a4 to b882d81 Compare October 23, 2026 14:20
@sf624
sf624 merged commit 2fa7b82 into main Oct 23, 2026
11 checks passed
@sf624
sf624 deleted the refactor/3.2-split branch October 23, 2026 14:41

This branch was successfully deployed

1 active deployment
github-pages — b882d81a Deployed Oct 23, 2026 by sf624 via Deploy to GitHub Pages #531
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