On Tue, 2014-07-08 at 11:23 +0200, Andreas Lauser wrote:
> Hi,
>
> On Tuesday 08 July 2014 11:15:04 Bård Skaflestad wrote:
> > On Tue, 2014-07-08 at 10:46 +0200, Andreas Lauser wrote:
> > > We now get a test failure in opm-parser because of this on Arne's machine,
> >
> > I too get a failure in "runIntegrationTests". The direct cause of the
> > failure is line 123 of runIntegrationTest.cpp,
> >
> > > // user defined quantity. (regex needs to be used.)
> > > BOOST_CHECK(parser->canParseDeckKeyword("WUFOO"));
> >
> > I don't know what regular expression this is supposed to match.
>
> The WU.+ keywords tag user-defined well quantities for output in the summary
> section. They are defined by the WELL_PROBE parser keyword.
I see. In that case I can make the test suite go through using the
following change
diff --git a/opm/parser/eclipse/Parser/ParserKeyword.cpp
b/opm/parser/eclipse/Parser/ParserKeyword.cpp
index dcf2150..0d79fc1 100644
--- a/opm/parser/eclipse/Parser/ParserKeyword.cpp
+++ b/opm/parser/eclipse/Parser/ParserKeyword.cpp
@@ -509,7 +509,7 @@ namespace Opm {
void ParserKeyword::setMatchRegex(const std::string&
deckNameRegexp) {
try {
#if HAVE_REGEX
- m_matchRegex = std::regex(deckNameRegexp);
+ m_matchRegex = std::regex(deckNameRegexp,
std::regex::extended);
#else
m_matchRegex = boost::regex(deckNameRegexp);
#endif
>
> > And as for grammars, you can select those--options being Perl 5, basic,
> > and extended for Boost.Regex and ECMA, basic, extended, grep, egrep, and
> > awk for std::. None of the std:: options match Roland's pattern though.
>
> I think for the opm-parser use case, the most simple option is sufficient.
> The
> only catch is that the syntax (basically where to put backslashes and where
> not) should stay the same.
Technically, no. The "most simple" option (std::regex::basic) is not
sufficient. For instance, that option does not support the "+"
quantifier. You need std::regex::extended (or std::regex::awk). In
principle, the ECMA (default) option should be sufficient too, but that
does not appear to be sufficiently well implemented in earlier
toolchains.
Bård
_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm