#93 closed enhancement (fixed)
Lexer should print verbose information on error
Reported by: | kilian | Owned by: | kilian |
---|---|---|---|
Priority: | P4 | Milestone: | |
Component: | core | Version: | 2.0.0alpha |
Severity: | major | Keywords: | |
Cc: |
Description
Error messages should contain precise info about the location of an error, including the current column and token. This info is maintained by the lexer, but currently not used.
Change History (9)
comment:1 Changed 15 years ago by
Milestone: | v2.0final → v2.0-rc2 |
---|---|
Priority: | P3 → P1 |
Severity: | normal → critical |
comment:2 Changed 15 years ago by
... what is ambiguous here? If sqrts is not set, the energy is zero.
comment:3 Changed 15 years ago by
Priority: | P1 → P4 |
---|---|
Severity: | critical → major |
Status: | new → assigned |
I opened a new ticket #188 for error messages in general. This ticket is concerned with the lexer only, i.e., being more verbose on reporting syntax (and I/O) errors.
I'll have it done for RC2.
comment:4 Changed 15 years ago by
Well, if sqrts is not present at all, the user should be informed about this. I would simply change the message to
"Colliding momenta: please set sqrts"
comment:6 Changed 15 years ago by
Milestone: | v2.0-rc2 → v2.0-rc3 |
---|
comment:7 Changed 15 years ago by
Milestone: | v2.0-rc3 → v2.0-rc4 |
---|
comment:8 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
r2202 implements the features that can be done now. In case of syntax errors, the lexer now spits out an explicit error message, showing location and context.
For other error messages, this is not possible, since they occur when the script is executed. Line info would have to be appended to all parse nodes, if the location within the script is to be shown. I postpone this until the whole diagnostics system gets an overhaul (#116), closing the current ticket.
I just start collecting examples of syntax which gives ambiguos or strange error messages: MESSAGE 1: if sqrts have not been set at all: