Diagnostic and cause
LinkTemplate 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.
Related rule: Trigger and repairResponse
Align the content indentation with the closing delimiter, preserving the indentation that belongs in the resulting string.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 188-196 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 189-189 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 182-192 - compiler/crates/topaz_self_frontend/topaz/literal.tpz at
151141d7bb44· 202-238 - TPZ0006 at
151141d7bb44
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.
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
- compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 182-192 - compiler/crates/topaz_self_frontend/topaz/literal.tpz at
151141d7bb44· 202-238 - TPZ0006 at
151141d7bb44
Response
LinkAlign the content indentation with the closing delimiter, preserving the indentation that belongs in the resulting string.
Reproduction and verification
LinkRejected program
Linklet message = """text"""
No stdout.
Expected result
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 188-196 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 189-189 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 182-192 - compiler/crates/topaz_self_frontend/topaz/literal.tpz at
151141d7bb44· 202-238 - TPZ0006 at
151141d7bb44
Corrected program
Linklet message = """text"""
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
- compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 182-192 - compiler/crates/topaz_self_frontend/topaz/literal.tpz at
151141d7bb44· 202-238 - TPZ0006 at
151141d7bb44