diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 01:44:36 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | cf347f91ee838759dc44ed34ec6ff320186e90ce (patch) | |
| tree | 36ff7d47d815b3d7e21147395be7289b23f4d400 /src/vector/morph.zig | |
| parent | f1d610eebed84b5ff06860a71752b6eb459dfae8 (diff) | |
| download | sketchbook-cf347f91ee838759dc44ed34ec6ff320186e90ce.tar.gz sketchbook-cf347f91ee838759dc44ed34ec6ff320186e90ce.zip | |
One verb table: the flags, the console's, the script's and ctl's words are rows
Six hand-kept lists said one vocabulary: root.zig's parser, its usage
and its header; the console's completion list, its help strings and the
execute chain; Host.zig's list of lines that do not move State; the
script's header comment and its step chain; control.zig's names and its
magic node numbers. Now each is a table, and the parser, the help, the
completion and the dispatch read it.
- root.zig: `Flag`, an enum, and `flags`, a row each (arg, doc): the
loop looks the word up, takes its argument when the row names one, and
a switch sets what it means; `usage` is made from the rows at compile
time (the same text, and a line for --help). Errors say the flag and
what it needs.
- Console.zig: `Verb` and `verbs`, a row each (args, doc, moves_state):
execute is a switch on the verb, a line whose first word is none goes
to the sketch as before; Tab completes from the rows (a verb, and with
each lowercase word its first argument may be: `seek start`); `help`
prints the rows wrapped to the log's width, `help VERB` its line.
- Host.zig: movesState asks the row; a sketch's command moves State.
- script.zig: `Verb` and `verbs` (args, doc, frame, input): step is a
switch, a row with `frame` is followed by one; the input verbs are
`input`, which a 9P ctl will call live.
- control.zig: `File` and `files` (mode, doc), a node being its number
(the same numbers); `Verb` and `verbs` for ctl's own two words.
Behaviour is unchanged but for help's text, completion's list (the same
words, and `timing`, `play`, `seek`... alone) and errors' words. The
diff adds more than it deletes (+630 -521): the rows carry a line of doc
for every verb, which nothing had before.
Tests: test-control, test-timing, test-setup, test-same, test-kill,
test-past, test-import, test-paths: 70/70 steps, 29/29 tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/vector/morph.zig')
0 files changed, 0 insertions, 0 deletions
