| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|