Feature #13363

More precise error location in FHiCL parser

Added by Robert Sulej over 4 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
1.00 h
Spent time:


Please, provide more precise error location for FHiCL parsing.
An example is: if a colon after parameter table (like in the usual algorithm or module configuration, code example below) is missed, then parser points to the first line of this file, if it is included from another file (message below the configuration example).

Example file with parameter tables:


standard_spacepointalg: {
MaxDT: 2.0
MaxS: 0.3
MinViews: 2
EnableU: true
EnableV: true
EnableW: false
Filter: true
Merge: false
PreferColl: false

  1. *****************************
  2. if I missed the colon in the next line, the error msg points to first line, which is BEGIN PROLOG
    standard_pmalgfitter: {
    TrackingOnlyPdg: [0]
    TrackingSkipPdg: [11]
    RunVertexing: false
  3. *****************************

standard_trackstitcheralg: {
CosAngTolerance: 0.98
SpptSepTolerance: 30.0 # cm
CommonComponentStitch: true

The above example leads to the message:

Failed to parse the configuration file 'job_fd/reco_pmtrack.fcl' with exception
---- Parse error BEGIN
detected at or near line 1, character 1, of file "/home/robert/fnal/v6/build_slf6.x86_64/larreco/job/trackfinderalgorithms.fcl"
included from line 1 of file "/home/robert/fnal/v6/build_slf6.x86_64/larreco/job/clusteralgorithms.fcl"
included from line 2 of file "/home/robert/fnal/v6/build_slf6.x86_64/dunetpc/job/hitfindermodules_dune.fcl"
included from line 2 of file "/home/robert/fnal/v6/build_slf6.x86_64/dunetpc/job/caldata_dune.fcl"
included from line 2 of file "./job_fd/reco_pmtrack.fcl"

---- Parse error END
err_message_example.txt (1.35 KB) err_message_example.txt Robert Sulej, 07/28/2016 03:55 AM


#1 Updated by Robert Sulej over 4 years ago

Sorry, text formatting made disaster with the copy-pasted message examples. I attach file with clean fhicl code and output message.

#2 Updated by Christopher Green over 4 years ago

  • Category set to Infrastructure
  • Status changed from New to Resolved
  • Assignee set to Christopher Green
  • % Done changed from 0 to 100
  • Estimated time set to 1.00 h
  • SSI Package fhicl-cpp added
  • SSI Package deleted ()

Implemented with fhicl-cpp:2fd40f4.

You will now receive error location information with the same specificity regardless of whether the error is within a prolog block.

#3 Updated by Kyle Knoepfel over 4 years ago

  • Status changed from Resolved to Closed
  • Target version set to 2.02.00

#4 Updated by Kyle Knoepfel over 4 years ago

  • Project changed from art to fhicl-cpp
  • Category deleted (Infrastructure)

#5 Updated by Robert Sulej over 4 years ago

Btw.... thanks a lot for implementing this!

Also available in: Atom PDF