Invocation, options and results
Linktopaz parse
topaz parse <file>
Input
Supply exactly one file operand. The file must be readable UTF-8 and fit the source size limit. An unreadable file, malformed encoding, invalid syntax, unsupported language mode, or unavailable selected compiler fails.
Compiler selection, verbosity, language selection, and positive compiler resource budgets use the listed options. A missing operand, extra operand, unknown option, unsupported format selector, joined option value, or repeated option is rejected before parsing.
Options and conflicts
| Option | Default | Contract | Conflicts |
|---|---|---|---|
--compiler rust|self | self | compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source. | None listed |
--verbose | false | Reports the selected compiler and whether it was explicit or the default. For | None listed |
--language-version <5.21> | 5.21 | language version selector | None listed |
--compiler-memory-mib <MiB> | 8192 | self compiler worker memory budget (8192); overrides TOPAZ_COMPILER_MEMORY_MIB A positive integer is required. Environment input: TOPAZ_COMPILER_MEMORY_MIB. | None listed |
--compiler-time-ms <ms> | 1800000 | self compilation wall-clock budget (1800000); overrides TOPAZ_COMPILER_TIME_MS A positive integer is required. Environment input: TOPAZ_COMPILER_TIME_MS. | None listed |
Output channels
stdout
stderr
Exit status
0
The complete source file has valid syntax.
1
Argument validation, source loading, parsing, compiler selection, or compiler execution fails.
Effects
The command reads the named source and installed compiler resources. It does not modify source, package files, lockfiles, or vendor content. A compiler may create and remove its owned temporary workspace.
The command performs no network access and does not fetch dependencies.
With the same source bytes, path spelling, language mode, compiler identity, resource settings, and diagnostic presentation settings, parsing produces the same verdict and report. Host I/O errors and resource exhaustion depend on the host.
A file is parsed independently of package resolution. The command does not load imports, regenerate a lock, or resolve registry versions.
Operation
LinkUse parse to isolate syntax problems before name resolution and type checking.
Option conditions
Link- cannot be combined with bootstrap - or -
Behavior contract
LinkCommand behavior
Arguments and rejection
Supply exactly one file operand. The file must be readable UTF-8 and fit the source size limit. An unreadable file, malformed encoding, invalid syntax, unsupported language mode, or unavailable selected compiler fails.
Compiler selection, verbosity, language selection, and positive compiler resource budgets use the listed options. A missing operand, extra operand, unknown option, unsupported format selector, joined option value, or repeated option is rejected before parsing.
Output
Successful parsing writes the input path followed by parse- and a newline to standard output. Diagnostics and a failure count use standard error. Verbose compiler selection also uses standard error.
- is rejected. This command has no selectable machine report. A syntax failure never emits the success line.
Exit status
Exit 0 means the parser accepted the file. Exit 1 covers argument validation, loading, parser diagnostics, unsupported compiler selection, and worker failure or exhausted budget.
Filesystem effects
The command reads the named source and installed compiler resources. It does not modify source, package files, lockfiles, or vendor content. A compiler may create and remove its owned temporary workspace.
Network access
The command performs no network access and does not fetch dependencies.
Reproducibility
With the same source bytes, path spelling, language mode, compiler identity, resource settings, and diagnostic presentation settings, parsing produces the same verdict and report. Host I/O errors and resource exhaustion depend on the host.
Packages and locks
A file is parsed independently of package resolution. The command does not load imports, regenerate a lock, or resolve registry versions.
Why
Parsing answers whether a file has valid syntax before any dependency, type, or runtime obligation is considered. Its report must not imply those later checks succeeded.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/commands/parse.rs at
b48527d0a174
The linked public CLI recipe checks one valid generic declaration, exit 0, its exact success line, and empty standard error.
The existing safe recipe covers a valid generic declaration. Missing files, invalid syntax, resource failures, and alternate options require argument vectors outside that allowlist.
Example contract
LinkExample contract
The invocation topaz parse main. is expected to exit with 0.
The current SELF parser accepts the complete generic declaration. It prints the fixture path followed by parse-ok.
Why
A generic declaration is ordinary Topaz syntax. Parsing it does not require choosing concrete type arguments or calling the function.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/commands/parse.rs at
b48527d0a174
Example
LinkSmall source invocation
Linkfunction identity<T>(value: T) -> T {value}
main.tpz: parse-ok
Expected result
Expected result
Parsing accepts the program. Exit code 0.
main.tpz: parse-ok
The current SELF parser accepts the complete generic declaration. It prints the fixture path followed by parse-ok.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/commands/parse.rs at
b48527d0a174
Verification scope
LinkObserved with Topaz 5.21.3 on 2026-11-06T08:36:29.642Z. This invocation passed; exit 0. 3 assertions were evaluated against the independent expected result. Execution record. This result covers the displayed invocation. That record uses the earlier fixture revision. The current recipe has not been run.