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

    TPZ0003: Unterminated string

    A string or template literal ended before its closing delimiter.

    Diagnostic and cause

    Link

    Unterminated string

    Family
    topaz
    Phase
    lex
    Code
    TPZ0003

    Cause and conditions

    A single-line string must close before its line break. An unclosed string produces TPZ0003 at its opening delimiter.

    Response

    Match the opening and closing delimiters and finish any interpolation. Escape a delimiter that belongs in the text.

    Source evidence

    Compiler phase: lex.

    Compiler explanation: A string or template literal ended before its closing delimiter.

    Message templates are Pending. The explanation above is not an observed CLI message.

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ0003]: single-line string literal is not closed before the line break

    The single-line string in the example reaches a line break before a closing quote. The lexer reports the opening delimiter.

    Rulediagnostics.tpz0003.rule

    Trigger and repair

    A single-line string must close before its line break. An unclosed string produces TPZ0003 at its opening delimiter.

    Source evidence

    Response

    Link

    Match the opening and closing delimiters and finish any interpolation. Escape a delimiter that belongs in the text.

    Reproduction and verification

    Link

    Rejected program

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

    Expected result

    Rejection during lex. Nonzero exit.

    • TPZ0003 diagnostic-tpz0003 at example.tpz:1:15

    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 = "unfinished"
    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