본문으로 건너뛰기
토파즈6.0 · 출시 전
다운로드 →

문서 검색

명세 6.0

방향키로 결과를 고르고 Enter를 눌러 여세요.

API 이름, 진단 번호, 규칙 또는 프로젝트 주제를 입력하세요.

    도구

    parse

    Parses a Topaz source file and reports whether its syntax is accepted.

    Invocation, options and results

    링크

    topaz parse

    호출 형식
    1. 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|selfself

    compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source.

    없음
    --verbosefalse

    Reports the selected compiler and whether it was explicit or the default. For version, prints the detailed release report.

    없음
    --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

    링크

    --compiler cannot be combined with bootstrap --producer or --self-source

    Behavior contract

    링크
    규칙tools-commands-parse.rule.behavior

    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-ok and a newline to standard output. Diagnostics and a failure count use standard error. Verbose compiler selection also uses standard error.

    --format json 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

    링크
    규칙tools-commands-parse.rule.invocation

    Example contract

    The invocation topaz parse main.tpz --language-version 5.21 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

    링크
    main.tpzSmall source invocation플레이그라운드 열기 →
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    기대 출력종료 코드 0
    main.tpz: parse-ok
    
    $ topaz parse main.tpz --language-version 5.21 · 대상 제품 5.21.3
    기대 결과

    기대 결과

    구문 분석이 프로그램을 받아들입니다. 종료 코드 0.

    기대 표준 출력
    1. 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.

    Related references

    링크

    Compiler selection →

    Packages, locks and targets →

    메뉴

    다운로드 →