Project

General

Profile

Necessary Maintenance #17893

Make error message for PROLOG section not allowed be clearer

Added by Gianluca Petrillo almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
10/12/2017
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Duration:

Description

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).

include2.fcl (17 Bytes) include2.fcl Included file with no PROLOG (error!) Gianluca Petrillo, 10/12/2017 03:51 PM
include1.fcl (43 Bytes) include1.fcl Included file with PROLOG Gianluca Petrillo, 10/12/2017 03:51 PM
include3.fcl (43 Bytes) include3.fcl Included file with PROLOG Gianluca Petrillo, 10/12/2017 03:51 PM
master.fcl (88 Bytes) master.fcl Master FHiCL file Gianluca Petrillo, 10/12/2017 03:51 PM

History

#1 Updated by Marc Paterno almost 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Christopher Green
  • Estimated time set to 2.00 h

#2 Updated by Christopher Green almost 2 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?

#3 Updated by Gianluca Petrillo almost 2 years ago

If I had seen this message, I would have known how to follow. So it's good for me.

#4 Updated by Christopher Green almost 2 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Resolved with 8ca65e0.

#5 Updated by Kyle Knoepfel almost 2 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF