Necessary Maintenance #17893
Make error message for PROLOG section not allowed be clearer
Current FHiCL does not allow by default interleaving
PROLOG sections with definitions outside prologues.
Parsing such configurations like:
BEGIN_PROLOG include1info: 0 END_PROLOG include2info: 0 BEGIN_PROLOG include3info: 0 END_PROLOG masterInfo: 3(
fhicl-expand master.fcl) will result in the error message:
---- Parse error BEGIN detected at or near line 1, character 1, of file "./include3.fcl" included from line 3 of file "./master.fcl" BEGIN_PROLOG ^ ---- Parse error END(
fhicl-dump master.fcl) which point to the right place but does not explain why that is a problem.
The explanation of that rule being violated in the error message may help the user to realise the source of the problem (which in teh example is, in fact, in the previous included file).
#2 Updated by Christopher Green over 3 years ago
- Status changed from Assigned to Feedback
- Target version set to 2.09.00
- % Done changed from 0 to 90
Unfortunately it is not practical to distinguish the two cases, but in the event that either case (non-contiguous or nested) is detected, the parse error includes the note, "PROLOG blocks must be both contiguous and not nested," viz:
---- Parse error BEGIN detected at or near line 5, character 1, of file "/home/greenc/work/cet-is/build/mrb-art-v2-develop/srcs/fhiclcpp/fhiclcpp/test/testFiles/fail/prol og4_fail.fcl" BEGIN_PROLOG ^ PROLOG blocks must be both contiguous and not nested. ---- Parse error END
Is this a reasonable and clear message?