Skip to content

punix check

Type-check a PCL file or directory; print ok or a located [E#].

Synopsis

punix check FILE

FILE can be:

  • a single .pcl file (composed as-is);
  • a directory (every *.pcl under it composed into one program).

What it does

FILE → parse → check → (lower omitted) → exit 0

Runs the type checker only. No IR lowering, no realise, no I/O beyond reading the source. The pass is single-shot (one syntax-directed walk over the typed AST); it cannot diverge.

Output

Success:

ok

Failure — every error is located with file:line:col and [E#]:

stack.pcl:5:3: error: [E1] type mismatch in 'version': expected Str, got Int

stack.pcl:12:8: error: [E2] unknown field 'pacakge' on module 'Stack'
  hint: did you mean 'package'?

Exit codes:

  • 0 — clean.
  • 1 — at least one located error.
  • 2 — usage error (FILE missing, unreadable, not a directory).

When to use

Always run check before buildcheck is fast and catches every type error before any realise machinery runs. The CI matrix's lint step includes check over the corpus.

Examples

punix check hello.pcl
# ok

punix check pkgs/
# pkgs/curl.pcl:8:3: error: [E1] expected Str, got List<Str>
# pkgs/openssl.pcl:14:5: error: [E3] missing required field 'version'