Diagnostic and cause
LinkSemicolon in delimiter list
- Family
- topaz
- Phase
- layout
- Code
TPZ1001
Cause and conditions
List elements use commas. A semicolon in a delimiter list produces TPZ1001 at the semicolon.
Related rule: Trigger and repairResponse
Use a comma between list elements. Put independent statements in a block that accepts statements.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 206-214 - compiler/crates/topaz_self_frontend/topaz/layout.tpz at
151141d7bb44· 275-275 - compiler/crates/topaz_self_frontend/topaz/layout.tpz at
151141d7bb44· 268-282 - TPZ1001 at
151141d7bb44
Compiler phase: layout.
Compiler explanation: A semicolon appeared where a comma/newline-separated delimiter list is required.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
;does not separate items inside a delimiter list; use,Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ1001]:
;does not separate items inside a delimiter list; use,
A semicolon occurs inside a list whose elements require a list separator. Statement separation does not make it an element separator.
Trigger and repair
List elements use commas. A semicolon in a delimiter list produces TPZ1001 at the semicolon.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/layout.tpz at
151141d7bb44· 268-282 - TPZ1001 at
151141d7bb44
Response
LinkUse a comma between list elements. Put independent statements in a block that accepts statements.
Reproduction and verification
LinkRejected program
Linklet values = [1; 2]
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· 206-214 - compiler/crates/topaz_self_frontend/topaz/layout.tpz at
151141d7bb44· 275-275 - compiler/crates/topaz_self_frontend/topaz/layout.tpz at
151141d7bb44· 268-282 - TPZ1001 at
151141d7bb44
Corrected program
Linklet values = [1, 2]
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/layout.tpz at
151141d7bb44· 268-282 - TPZ1001 at
151141d7bb44