README.md 1.3 KB

Standard Pascal validator pilot

pascal.atg is the installed J&W standard-Pascal grammar with one fix: IGNORE CASE moved right after COMPILER (this Coco/R version rejects it anywhere later, and silently scans case-sensitively). The grammar is otherwise strict ISO 7185: no ELSE in CASE (fpc -Miso accepts it, but standard Pascal has none), no $ hex, END. without module name.

Build

./build.sh        # -> build/PStd (build/ is git-ignored)

Needs CR (Coco/R), gm2 -fiso, the parser.frm/scanner.frm frames and FileIO.def/.mod — all resolved from the environment with sensible defaults (CRFRAMES, M2LIB, CR, GM2). Note: link via the two-step module list (-fgen-module-list then -fuse-list); a single-step link trips over pre-existing errors in this gm2 build's own ISO library .def files (RndFile/TermFile/ChanConsts set-constructor complaints).

Differential results (PStd vs fpc -Miso)

Accept battery + tests/deep.pas (const/type/var, records, enums, sets, subranges, nested functions, labels/goto, all statements, hex-free literals): 0 false positives. Broken mutants: 0 missed, positions close. fpc leniencies correctly not followed: missing/trailing ;, unary +, which the strict grammar rejects (documented, fpc accepts).