diff --git a/opm/parser/eclipse/RawDeck/RawConsts.hpp b/opm/parser/eclipse/RawDeck/RawConsts.hpp index e2759ebff..d130abc78 100644 --- a/opm/parser/eclipse/RawDeck/RawConsts.hpp +++ b/opm/parser/eclipse/RawDeck/RawConsts.hpp @@ -48,7 +48,7 @@ namespace Opm { */ constexpr bool sep_table[ 128 ] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -60,7 +60,7 @@ namespace Opm { struct is_separator { /* - * ch is space, comma, \r, \n, \t, \v or \f => true + * ch is SOH (ASCII 1), space, comma, \r, \n, \t, \v or \f => true * else false */ constexpr bool operator()( int ch ) const { diff --git a/tests/parser/ParserTests.cpp b/tests/parser/ParserTests.cpp index ca61a7991..c2c943072 100644 --- a/tests/parser/ParserTests.cpp +++ b/tests/parser/ParserTests.cpp @@ -1976,6 +1976,25 @@ DENSITY BOOST_CHECK( pbub.defaultApplied( 0 ) ); } +BOOST_AUTO_TEST_CASE(IGNORE_SOH) { + // Check that parsing RSCONSTT does not bleed into next keyword. + + const auto deck_string = std::string { R"( +FIELD +TABDIMS + 1* 2 +/ +-- The ^A should be here - that is ASCII character 1 which is sometimes +-- inserted by the windows editor Notepad++ +PROPS +RSCONSTT + 0.35 932 / + 0.40 945 / +)" }; + + const auto deck = Parser{}.parseString( deck_string ); +} + BOOST_AUTO_TEST_CASE(ParseRSConstT) { // Check that parsing RSCONSTT does not bleed into next keyword.