|
[yoda-svn] yoda: Catch and make useful noise about YAML parsing failures in...YODA Mercurial yoda at projects.hepforge.orgFri Sep 1 13:00:02 BST 2017
details: https://yoda.hepforge.org/hg/yoda/rev/da0291add8e3 branches: changeset: 1382:da0291add8e3 user: Andy Buckley <andy at insectnation.org> date: Fri Sep 01 12:50:53 2017 +0100 description: Catch and make useful noise about YAML parsing failures in YODA reading diffs (truncated from 106 to 50 lines): --- a/src/Reader.cc Fri Aug 25 20:19:30 2017 +0100 +++ b/src/Reader.cc Fri Sep 01 12:50:53 2017 +0100 @@ -23,7 +23,7 @@ if (fmt == "yoda") return ReaderYODA::create(); if (fmt == "aida") return ReaderAIDA::create(); if (fmt == "dat" || fmt == "flat") return ReaderFLAT::create(); - if (fmtex == "yoda.gz") { + if (fmt == "yodz" || fmtex == "yoda.gz") { #ifdef HAVE_LIBZ return ReaderYODA::create(); #else --- a/src/ReaderYODA.cc Fri Aug 25 20:19:30 2017 +0100 +++ b/src/ReaderYODA.cc Fri Sep 01 12:50:53 2017 +0100 @@ -88,13 +88,13 @@ } - void ReaderYODA::read(istream& _stream, vector<AnalysisObject*>& aos) { + void ReaderYODA::read(istream& stream_, vector<AnalysisObject*>& aos) { #ifdef HAVE_LIBZ // zstr detects if file is deflated or plain-text - zstr::istream stream(_stream); + zstr::istream stream(stream_); #else - auto& stream = _stream; + auto& stream = stream_; #endif // Data format parsing states, representing current data type @@ -142,7 +142,6 @@ // Ignore comments (whole-line only, without indent, and still allowed for compatibility on BEGIN/END lines) if (s.find("#") == 0 && s.find("BEGIN") == string::npos && s.find("END") == string::npos) continue; - // Now the context-sensitive part if (context == NONE) { @@ -215,6 +214,7 @@ // cout << aocurr->path() << " " << nline << " " << context << endl; } else { + /// @todo Flatten conditional blocks with more else-ifs? // Throw error if a BEGIN line is found @@ -258,30 +258,40 @@ case NONE: break; }
More information about the yoda-svn mailing list |