Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Инструменты

    Выбор компилятора

    Select the compiler and language mode for a Topaz invocation, then confirm the selection in the command output.

    Select a compiler

    Ссылка

    Run topaz compiler status --format json to inspect the installed compiler before choosing an implementation. Run topaz version to identify the product release.

    An explicit --compiler self selects SELF. An explicit --compiler rust selects the reference compiler for verification. When the selector is absent, compiler-bearing commands use SELF. A rejected operation does not silently switch to the reference compiler.

    Default selection source · Selection validation source

    Compiler selection and artifact selection answer different questions. --compiler rust chooses an implementation. emit --target rust requests Rust source. A native build target can use SELF. Read the command reference for the supported combinations.

    Select the language mode

    Ссылка

    For an entry-file invocation, the current language mode is used when --language-version is absent. The public 5.21.x CLI accepts the current 5.21 mode. A product patch version such as 5.21.3 identifies a release, not a separate language mode.

    Language selector source

    During package-mode compilation, [package].language in topaz.toml supplies the language mode before entry-source loading. An explicit language selector must agree with the manifest. A different manifest mode or a conflicting selector is rejected.

    Package selection source

    Keep the selected package root consistent across check, run, and build invocations. An entry operand normally selects an entry-file route. The test command also preserves package context when its selected root contains a manifest.

    Command scope

    Ссылка

    Compiler selection applies to parse, dump-ast, check, run, test, fmt, lsp, emit, build, doc, bench, and compiler observe.

    Compiler-bearing command source

    Package management, storage, embedded Lispex, lookup, metadata, and compiler inspection commands use their own command contracts. They reject an explicit --compiler selector. This includes compiler preview, compiler status, compiler validate, and compiler compare.

    Selector applicability source

    compiler preview selects its producer through its preview options. Combining --compiler with --producer or --self-source is rejected. Producer selection does not change the default used by a later check or build invocation.

    Confirm the selection

    Ссылка

    Add --verbose to a compiler-bearing invocation to report the selected compiler on standard error. The report distinguishes an explicit choice from the current default with explicit and current-default.

    Selection report source

    An LSP session may receive its package root during initialize. Its compiler selection is reported after the workspace supplies the language mode.

    topaz compiler status --format json returns installed compiler identity, the default and reference selectors, and command support conditions. Read that inventory alongside the command's options and conflicts. Status output describes the installed tool. A successful status request is not a successful check or build.

    Status output source

    Usage profiles

    Ссылка

    A check usage profile adds checks for an intended use. The check contract defines its inputs, diagnostics, and reports. Installed profile availability remains a distribution evidence question.

    Type checking without a mode flag

    Ссылка
    Правилоtopaz.tools.types-option.rule

    Type checking without a mode flag

    Use topaz check <entry> for type checking. --types is rejected during command validation.

    Причина

    The check command performs type checking with or without the ineffective flag. Both spellings request the same operation, so the flag has no separate intent to preserve.

    Type checking without a mode flag rejection

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    types-option

    Причина и условия

    Use topaz check <entry> for type checking. --types is rejected during command validation.

    Действия

    Run topaz check <entry> without --types.

    Type checking without a mode flag examples

    Ссылка

    Reject the unused types option

    Ссылка
    main.tpzReject the unused types optionОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format json --types · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Check with the canonical command

    Ссылка
    main.tpzCheck with the canonical commandОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz check main.tpz --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Named metadata commands and long options

    Ссылка
    Правилоtopaz.tools.metadata-spellings.rule

    Named metadata commands and long options

    Use topaz version for the installed release report. topaz --version and topaz -V are rejected during command validation.

    Use --verbose for additional command details. -v is rejected during command validation.

    Причина

    The version aliases request the same installed release report as the version command. The short verbosity alias requests the same additional detail as the verbose option. Neither alias expresses a different intent.

    Named metadata commands and long options rejection

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    metadata-spellings

    Причина и условия

    Use topaz version for the installed release report. topaz --version and topaz -V are rejected during command validation.

    Use --verbose for additional command details. -v is rejected during command validation.

    Use topaz version for the installed release report. topaz --version and topaz -V are rejected during command validation.

    Use --verbose for additional command details. -v is rejected during command validation.

    Действия

    Use topaz version and add --verbose when a detailed report is needed.

    Named metadata commands and long options examples

    Ссылка

    Reject the version flag alias

    Ссылка
    main.tpzReject the version flag aliasОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz --version · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Reject the short version alias

    Ссылка
    main.tpzReject the short version aliasОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz -V · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Reject the short detail alias

    Ссылка
    main.tpzReject the short detail aliasОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz version -v · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Read the installed release

    Ссылка
    main.tpzRead the installed releaseОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    Topaz 5.21.3
    
    $ topaz version · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Ожидаемый стандартный вывод
    1. Topaz 5.21.3

    Request the detailed release report

    Ссылка
    main.tpzRequest the detailed release reportОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    $ topaz version --verbose · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Separate option values

    Ссылка
    Правилоtopaz.tools.value-separator.rule

    Separate option values

    An option and its value occupy separate arguments, as in --format json. The --option=value form is rejected during command validation.

    This rule applies to CLI options. Arguments after -- are program data and preserve their spelling.

    Причина

    The joined and separate forms supply the same value to the same option. A separate argument preserves that intent with one spelling and matches the command synopsis.

    Separate option values rejection

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    value-separator

    Причина и условия

    An option and its value occupy separate arguments, as in --format json. The --option=value form is rejected during command validation.

    Действия

    Pass each option and its value as separate arguments, such as --format json.

    Separate option values examples

    Ссылка

    Reject an equals format value

    Ссылка
    main.tpzReject an equals format valueОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format=json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Reject an equals language value

    Ссылка
    main.tpzReject an equals language valueОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format json --language-version=5.21 · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Pass values as separate arguments

    Ссылка
    main.tpzPass values as separate argumentsОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz check main.tpz --language-version 5.21 --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    One occurrence of each option

    Ссылка
    Правилоtopaz.tools.option-occurrence.rule

    One occurrence of each option

    An option appears at most once in an invocation. Repeated occurrences are rejected even when their values agree. The order of conflicting values does not select a winner.

    Repeated options are rejected as unexpected arguments. This rule does not reinterpret program arguments after --.

    Причина

    Each option selects one value or behavior. Rejecting repeated selectors prevents argument order from changing that choice and applies equally when the values agree.

    One occurrence of each option rejection

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    option-occurrence

    Причина и условия

    An option appears at most once in an invocation. Repeated occurrences are rejected even when their values agree. The order of conflicting values does not select a winner.

    Действия

    Give each CLI option once and resolve conflicting choices before invoking Topaz.

    One occurrence of each option examples

    Ссылка

    Reject a repeated language selector

    Ссылка
    main.tpzReject a repeated language selectorОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format json --language-version 5.21 --language-version 5.21 · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Reject conflicting formats in one order

    Ссылка
    main.tpzReject conflicting formats in one orderОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format json --format human · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Reject conflicting formats in the other order

    Ссылка
    main.tpzReject conflicting formats in the other orderОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format human --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Give each option once

    Ссылка
    main.tpzGive each option onceОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz check main.tpz --language-version 5.21 --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Reject a repeated boolean option

    Ссылка
    main.tpzReject a repeated boolean optionОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz check main.tpz --format json --verbose --verbose · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    One JSON format selector

    Ссылка
    Правилоtopaz.tools.json-format.rule

    One JSON format selector

    Use --format json for JSON output from check, compiler status, explain, bench, lispex embed info. --json is rejected during command validation. lispex embed info requires --format json and does not accept a human output format. Each command retains its own output fields and streams.

    The format selector changes the representation of a command result. It does not merge the different records. check writes its diagnostic JSON to standard error. The other listed commands write one report to standard output. lispex embed info requires JSON. The other listed commands retain their human output format. Timing values vary between benchmark executions.

    Причина

    The old JSON switch and the format selector request the same report representation. The shared selector preserves that intent while each command retains its own report. Export inspection and diagnostic reporting remain distinct operations.

    One JSON format selector rejection

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    json-format

    Причина и условия

    Use --format json for JSON output from check, compiler status, explain, bench, lispex embed info. --json is rejected during command validation. lispex embed info requires --format json and does not accept a human output format. Each command retains its own output fields and streams.

    Действия

    Use --format json with a CLI that implements the Topaz 6.0 output selector.

    One JSON format selector examples

    Ссылка

    Reject --json for compiler status

    Ссылка
    main.tpzReject --json for compiler statusОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz compiler status --json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Select JSON for compiler status

    Ссылка
    main.tpzSelect JSON for compiler statusОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    $ topaz compiler status --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Стандартный вывод содержит объект JSON. Полная схема не определена.

    Reject --json for diagnostic explanation

    Ссылка
    main.tpzReject --json for diagnostic explanationОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz explain TPZ4002 --json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Select JSON for diagnostic explanation

    Ссылка
    main.tpzSelect JSON for diagnostic explanationОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    $ topaz explain TPZ4002 --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Стандартный вывод содержит объект JSON. Полная схема не определена.

    Reject --json for benchmark report

    Ссылка
    main.tpzReject --json for benchmark reportОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz bench main.tpz --language-version 5.21 --json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Benchmark JSON with --format json

    Ссылка
    main.tpzBenchmark JSON with --format jsonОткрыть песочницу →
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    Ожидаемый выводКод завершения 0
    $ topaz bench main.tpz --language-version 5.21 --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Стандартный вывод содержит объект JSON. Полная схема не определена.

    The benchmark checks the fixture without running it and writes a JSON report. Timing values vary between executions.

    Reject --json for embedded component report

    Ссылка
    main.tpzReject --json for embedded component reportОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz lispex embed info --json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Ненулевой код завершения.

    Select JSON for embedded component report

    Ссылка
    main.tpzSelect JSON for embedded component reportОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    $ topaz lispex embed info --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Стандартный вывод содержит объект JSON. Полная схема не определена.

    Keep the check diagnostic format

    Ссылка
    main.tpzKeep the check diagnostic formatОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz check main.tpz --language-version 5.21 --format json · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    A command is required

    Ссылка
    Правилоtopaz.tools.command-presence.rule

    Name the help command

    Use topaz help for command and option help. topaz is rejected during command validation.

    An invocation must name a command. A missing command is a usage error with exit status 1 and empty standard output. The CLI reports the missing command on standard error and directs the user to topaz help. This textual failure has no TPZ code or source location.

    Причина

    An explicit help command requests the command reference. An omitted command supplies no operation and can result from a missing script argument. Requiring an explicit request keeps that mistake observable.

    Missing command

    Семейство
    topaz-cli
    Этап
    command
    Операция
    argument-validation
    Категория
    missing-command

    Причина и условия

    Use topaz help for command and option help. topaz is rejected during command validation.

    Действия

    Supply the command to run. Use topaz help to read the command and option help.

    Request help explicitly

    Ссылка

    Reject an invocation without a command

    Ссылка
    main.tpzReject an invocation without a commandОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 1
    Нет стандартного вывода.
    $ topaz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения command. Код завершения 1.

    Request help by name

    Ссылка
    main.tpzRequest help by nameОткрыть песочницу →
    1. let value = 1
    Ожидаемый выводКод завершения 0
    $ topaz help · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    topaz help prints the installed command and option help. Its wording and command inventory can grow. This example checks successful completion and an empty standard error stream.

    Related commands and configuration

    Ссылка

    compiler status →

    Packages, locks and targets →

    check →

    Меню

    Загрузка →