Skip to content

Commit

Permalink
Merge pull request #23611 from Dr15Jones/newBoostCutParser
Browse files Browse the repository at this point in the history
Handle any trailing white space
  • Loading branch information
cmsbuild committed Jun 20, 2018
2 parents e6fef05 + 95894c5 commit 8b5484a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CommonTools/Utils/src/MethodArgumentSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ namespace reco {
}
void operator()(const char *begin, const char *end) const {
assert(begin+1 <= end-1); // the quotes are included in [begin,end[ range.
//in boost 1.67, the parser appends any extra white space to the
// end
if(*(end-1) != *begin) {
--end;
}
stack_.push_back( AnyMethodArgument(std::string(begin+1,end-1)) );
}
private:
Expand Down
3 changes: 3 additions & 0 deletions CommonTools/Utils/test/testCutParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ void testCutParser::checkAll() {
check("quality('goodIterative')", true);
check("quality('looseSetWithPV')", false);
check("quality('highPuritySetWithPV')", false);
check("quality('highPuritySetWithPV' )", false);
check("quality( 'highPuritySetWithPV')", false);
check("quality( 'highPuritySetWithPV' )", false);

// check handling of errors
// first those who are the same in lazy and non lazy parsing
Expand Down

0 comments on commit 8b5484a

Please sign in to comment.