Add KeywordLocation argument to ParseContext::handleError()

This commit is contained in:
Joakim Hove
2020-09-29 09:56:07 +02:00
parent 94b4c509b1
commit e01400fa18
20 changed files with 337 additions and 260 deletions
+7 -3
View File
@@ -21,9 +21,10 @@
#ifndef OPM_PARSE_CONTEXT_HPP
#define OPM_PARSE_CONTEXT_HPP
#include <string>
#include <map>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <opm/common/OpmLog/OpmLog.hpp>
@@ -33,6 +34,9 @@
namespace Opm {
class KeywordLocation;
/*
The ParseContext class is meant to control the behavior of the
parsing and EclipseState construction phase when
@@ -87,8 +91,8 @@ namespace Opm {
explicit ParseContext(InputError::Action default_action);
explicit ParseContext(const std::vector<std::pair<std::string , InputError::Action>>& initial);
void handleError( const std::string& errorKey, const std::string& msg, ErrorGuard& errors ) const;
void handleUnknownKeyword(const std::string& keyword, ErrorGuard& errors) const;
void handleError( const std::string& errorKey, const std::string& msg, const std::optional<KeywordLocation>& location, ErrorGuard& errors) const;
void handleUnknownKeyword(const std::string& keyword, const std::optional<KeywordLocation>& location, ErrorGuard& errors) const;
bool hasKey(const std::string& key) const;
ParseContext withKey(const std::string& key, InputError::Action action = InputError::WARN) const;
ParseContext& withKey(const std::string& key, InputError::Action action = InputError::WARN);