Invocation, options and results
링크topaz parse
topaz parse <file>
입력
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.
옵션과 충돌
| 옵션 | 기본값 | 계약 | 충돌 |
|---|---|---|---|
--compiler rust|self | self | compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source. | 없음 |
--verbose | false | Reports the selected compiler and whether it was explicit or the default. For | 없음 |
--language-version <5.21> | 5.21 | language version selector | 없음 |
--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. | 없음 |
--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. | 없음 |
출력 채널
stdout
stderr
종료 상태
0
The complete source file has valid syntax.
1
Argument validation, source loading, parsing, compiler selection, or compiler execution fails.
효과
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
링크Use parse to isolate syntax problems before name resolution and type checking.
Option conditions
링크- cannot be combined with bootstrap - or -
Behavior contract
링크Command 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.
이유
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.
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
링크Example 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.
이유
A generic declaration is ordinary Topaz syntax. Parsing it does not require choosing concrete type arguments or calling the function.
Example
링크Small source invocation
링크function identity<T>(value: T) -> T {value}
main.tpz: parse-ok
기대 결과
기대 결과
구문 분석이 프로그램을 받아들입니다. 종료 코드 0.
main.tpz: parse-ok
The current SELF parser accepts the complete generic declaration. It prints the fixture path followed by parse-ok.
Verification scope
링크Observed 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.