Diagnostic and cause
LinkUnknown character
- Family
- topaz
- Phase
- lex
- Code
TPZ0001
Cause and conditions
A character that cannot start a Topaz token produces TPZ0001 at that character.
Related rule: Trigger and repairResponse
Replace the character with the intended Topaz spelling. A loop label needs a name after its opening apostrophe.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 143-151 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 524-524 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 548-567 - TPZ0001 at
151141d7bb44
Compiler phase: lex.
Compiler explanation: The lexer found a source character that is not part of the Topaz token set.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ0001]: unknown character
@
The lexer found a character that cannot start a token. For example, @ is rejected at its source position. A bare apostrophe is also rejected because a loop label needs an identifier after it.
Trigger and repair
A character that cannot start a Topaz token produces TPZ0001 at that character.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 548-567 - TPZ0001 at
151141d7bb44
Response
LinkReplace the character with the intended Topaz spelling. A loop label needs a name after its opening apostrophe.
Reproduction and verification
LinkRejected program
Linklet value = @
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· 143-151 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 524-524 - compiler/crates/topaz_self_frontend/topaz/raw.tpz at
151141d7bb44· 548-567 - TPZ0001 at
151141d7bb44
Corrected program
Linklet value = 1
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· 548-567 - TPZ0001 at
151141d7bb44