diff --git a/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp b/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp index 880e5139c..298438358 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp @@ -58,12 +58,10 @@ public: UDQWellSet eval_wells(const UDQContext& context) const; UDQSet eval(const UDQContext& context) const; const std::string& keyword() const; - /* - Should not be internalized at all - and will go away; but temporarily needed for testing. - */ - std::vector tokens; + const std::vector& tokens() const; UDQVarType var_type() const; private: + std::vector input_tokens; const UDQParams& udq_params; // Beacuse of the shared RNG stream this must be a reference. std::string m_keyword; std::shared_ptr ast; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp index 9ba4c8b5f..9f3158e69 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp @@ -122,7 +122,7 @@ UDQDefine::UDQDefine(const UDQParams& udq_params, } } this->ast = std::make_shared( UDQParser::parse(this->udq_params, tokens, parseContext, errors) ); - this->tokens = tokens; + this->input_tokens = tokens; } @@ -143,6 +143,9 @@ UDQVarType UDQDefine::var_type() const { return this->m_var_type; } +const std::vector& UDQDefine::tokens() const { + return this->input_tokens; +} const std::string& UDQDefine::keyword() const { return this->m_keyword; diff --git a/tests/parser/UDQTests.cpp b/tests/parser/UDQTests.cpp index 26071f9e7..292c132a3 100644 --- a/tests/parser/UDQTests.cpp +++ b/tests/parser/UDQTests.cpp @@ -924,13 +924,13 @@ BOOST_AUTO_TEST_CASE(UDQPARSE_TEST1) { UDQDefine def1(udqp, "WUBHP", {"1/(WWCT", "'W1*')"}); std::vector tokens1 = {"1", "/", "(", "WWCT", "W1*", ")"}; BOOST_CHECK_EQUAL_COLLECTIONS(tokens1.begin(), tokens1.end(), - def1.tokens.begin(), def1.tokens.end()); + def1.tokens().begin(), def1.tokens().end()); UDQDefine def2(udqp, "WUBHP", {"2*(1", "+" , "WBHP)"}); std::vector tokens2 = {"2", "*", "(", "1", "+", "WBHP", ")"}; BOOST_CHECK_EQUAL_COLLECTIONS(tokens2.begin(), tokens2.end(), - def2.tokens.begin(), def2.tokens.end()); + def2.tokens().begin(), def2.tokens().end()); }