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.