Add masp, a Go assembly macro preprocessor #6

Merged
techwritescode merged 1 commit from masp-go into main 2026-10-06 03:02:53 +00:00

Adds cmd/masp and internal/masp: a Go macro preprocessor for assembly source (.macro, .aif, .arepeat, .awhile, .equ, .assign, .assigna, .assignc, .include, data and string directives) with the options openvcl and ps2gl use (-c, -I, -o, -D, -P, -p, -s, -u). It replaces the C masp, which needed a native Windows build.

It is written from a behavioral specification and black-box comparison with the original, without reference to the original source.

Checked against the original:

  • ps2gl's 13 VU1 renderers and the openvcl inputs: output is byte-identical, including the -p -s echo layout openvcl reads for line numbers.
  • internal/masp/cli/testdata/spec-vectors.json: 1,241 stable cases taken from the original, all passing (go test ./...).
  • About 3,000 randomly generated programs the original accepts: no differences.

Not reproduced on purpose: the original's help/version text, its symbol-table hash-collision defects, the -l position markers (the original crashes on them), and a two-input-file .end quirk.

🤖 Generated with Claude Code

Adds cmd/masp and internal/masp: a Go macro preprocessor for assembly source (.macro, .aif, .arepeat, .awhile, .equ, .assign, .assigna, .assignc, .include, data and string directives) with the options openvcl and ps2gl use (-c, -I, -o, -D, -P, -p, -s, -u). It replaces the C masp, which needed a native Windows build. It is written from a behavioral specification and black-box comparison with the original, without reference to the original source. Checked against the original: - ps2gl's 13 VU1 renderers and the openvcl inputs: output is byte-identical, including the -p -s echo layout openvcl reads for line numbers. - internal/masp/cli/testdata/spec-vectors.json: 1,241 stable cases taken from the original, all passing (go test ./...). - About 3,000 randomly generated programs the original accepts: no differences. Not reproduced on purpose: the original's help/version text, its symbol-table hash-collision defects, the -l position markers (the original crashes on them), and a two-input-file .end quirk. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add masp, a Go assembly macro preprocessor
Some checks failed
Build / build (push) Has been cancelled
aff849a58a
Expands macros, conditionals, loops and includes in assembly source: .macro, .aif,
.arepeat, .awhile, .equ, .assign, .assigna, .assignc, .include and the data and string
directives, with the -c, -I, -o, -D, -P, -p, -s and -u options that openvcl and ps2gl use.
It is written from a behavioral specification and black-box comparison with the original
masp, without reference to its source.

Output is byte-identical to the original on ps2gl's VU1 renderers and the openvcl
inputs, with the exact -p -s echo layout openvcl reads. cli/testdata/spec-vectors.json
holds 1,241 stable cases taken from the original; all pass.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ps2/tools!6
No description provided.