whizard is hosted by Hepforge, IPPP Durham

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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 Juergen Reuter

Milestone: v2.0finalv2.0-rc2
Priority: P3P1
Severity: normalcritical

I just start collecting examples of syntax which gives ambiguos or strange error messages: MESSAGE 1: if sqrts have not been set at all:

| Loading process library 'processes'
Warning: Process 'p1': overwriting previous configuration
Warning: Process 'p2': overwriting previous configuration
| Integrating process 'p1'
*** Fatal error:  Colliding momenta: energy must be positive
| There were no errors and  2 warning(s).

comment:2 Changed 15 years ago by kilian

... what is ambiguous here? If sqrts is not set, the energy is zero.

comment:3 Changed 15 years ago by kilian

Priority: P1P4
Severity: criticalmajor
Status: newassigned

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 Juergen Reuter

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:5 Changed 15 years ago by kilian

sqrts: done [1685].

comment:6 Changed 15 years ago by Juergen Reuter

Milestone: v2.0-rc2v2.0-rc3

comment:7 Changed 15 years ago by Juergen Reuter

Milestone: v2.0-rc3v2.0-rc4

comment:8 Changed 15 years ago by kilian

Resolution: fixed
Status: assignedclosed

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.

comment:9 Changed 15 years ago by Juergen Reuter

Milestone: v2.0-rc4

Milestone v2.0-rc4 deleted

Note: See TracTickets for help on using tickets.