Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ0006: Template indentation mismatch

    A multiline template line does not match the closing delimiter indentation rule.

    Diagnostic and cause

    Link

    Template indentation mismatch

    Family
    topaz
    Phase
    lex
    Code
    TPZ0006

    Cause and conditions

    Each nonblank multiline-string content line must begin with the exact whitespace prefix of the closing delimiter. A line missing that prefix produces TPZ0006.

    Response

    Align the content indentation with the closing delimiter, preserving the indentation that belongs in the resulting string.

    Source evidence

    Compiler phase: lex.

    Compiler explanation: A multiline template line does not match the closing delimiter indentation rule.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • line does not begin with the closing indent of its multiline string Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ0006]: line does not begin with the closing indent of its multiline string

    The content line lacks the four-space prefix before this multiline string’s closing delimiter. Nonblank lines must match that prefix exactly.

    Rulediagnostics.tpz0006.rule

    Trigger and repair

    Each nonblank multiline-string content line must begin with the exact whitespace prefix of the closing delimiter. A line missing that prefix produces TPZ0006.

    Source evidence

    Response

    Link

    Align the content indentation with the closing delimiter, preserving the indentation that belongs in the resulting string.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. let message = """
    2. text
    3. """
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during lex. Nonzero exit.

    • TPZ0006 diagnostic-tpz0006 at example.tpz:2:1

    The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.

    Source evidence

    Corrected program

    Link
    example.tpzCorrected program
    1. let message = """
    2. text
    3. """
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    This program applies the repair described above. The verification status records whether it has been run.

    Source evidence

    Menu

    Download