diff --git a/include/plasp/pddl/ConsistencyException.h b/include/plasp/pddl/ConsistencyException.h index a8ec931..31941a5 100644 --- a/include/plasp/pddl/ConsistencyException.h +++ b/include/plasp/pddl/ConsistencyException.h @@ -19,7 +19,7 @@ class ConsistencyException: public std::exception { public: explicit ConsistencyException() - : ConsistencyException("Unspecified consistency error") + : ConsistencyException("unspecified consistency error") { } @@ -40,7 +40,7 @@ class ConsistencyException: public std::exception const char *what() const throw() { if (m_message.empty()) - return "Unspecified consistency error"; + return "unspecified consistency error"; return m_message.c_str(); } diff --git a/include/plasp/utils/ParserException.h b/include/plasp/utils/ParserException.h index e027a79..2bc5e4e 100644 --- a/include/plasp/utils/ParserException.h +++ b/include/plasp/utils/ParserException.h @@ -21,7 +21,7 @@ class ParserException: public std::exception { public: explicit ParserException(const utils::Parser &parser) - : ParserException(parser, "Unspecified parser error") + : ParserException(parser, "unspecified parser error") { } diff --git a/src/plasp/pddl/Description.cpp b/src/plasp/pddl/Description.cpp index 5740e7d..3ba5578 100644 --- a/src/plasp/pddl/Description.cpp +++ b/src/plasp/pddl/Description.cpp @@ -133,7 +133,7 @@ void Description::parse() findSections(); if (m_domainPosition == -1) - throw ConsistencyException("No PDDL domain specified"); + throw ConsistencyException("no PDDL domain specified"); parser.seek(m_domainPosition); m_domain->parse(); @@ -188,7 +188,7 @@ void Description::findSections() else { const auto sectionIdentifier = parser.parse(); - throw utils::ParserException(parser, "Unknown PDDL section “" + sectionIdentifier + "”"); + throw utils::ParserException(parser, "unknown PDDL section “" + sectionIdentifier + "”"); } m_context.parser.skipWhiteSpace(); diff --git a/src/plasp/pddl/Domain.cpp b/src/plasp/pddl/Domain.cpp index 6d80d08..b8e9ec9 100644 --- a/src/plasp/pddl/Domain.cpp +++ b/src/plasp/pddl/Domain.cpp @@ -53,7 +53,7 @@ void Domain::findSections() if (unique && sectionPosition != -1) { parser.seek(value); - throw utils::ParserException(parser, "Only one “:" + sectionName + "” section allowed"); + throw utils::ParserException(parser, "only one “:" + sectionName + "” section allowed"); } sectionPosition = value; @@ -94,7 +94,7 @@ void Domain::findSections() const auto sectionIdentifier = parser.parseIdentifier(isIdentifier); - m_context.logger.logWarning(parser, "Section type “" + sectionIdentifier + "” currently unsupported"); + m_context.logger.logWarning(parser, "section type “" + sectionIdentifier + "” currently unsupported"); parser.seek(sectionIdentifierPosition); } @@ -103,7 +103,7 @@ void Domain::findSections() const auto sectionIdentifier = parser.parseIdentifier(isIdentifier); parser.seek(position); - throw utils::ParserException(m_context.parser, "Unknown domain section “" + sectionIdentifier + "”"); + throw utils::ParserException(m_context.parser, "unknown domain section “" + sectionIdentifier + "”"); } // Skip section for now and parse it later @@ -279,7 +279,7 @@ void Domain::checkRequirement(Requirement::Type requirementType) const if (hasRequirement(requirementType)) return; - throw ConsistencyException("Requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); + throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -340,7 +340,7 @@ void Domain::parseTypeSection() while (parser.currentCharacter() != ')') { if (parser.currentCharacter() == '(') - throw utils::ParserException(parser, "Only primitive types are allowed in type section"); + throw utils::ParserException(parser, "only primitive types are allowed in type section"); expressions::PrimitiveType::parseTypedDeclaration(m_context, *this); diff --git a/src/plasp/pddl/Expression.cpp b/src/plasp/pddl/Expression.cpp index bec5954..b3a3d04 100644 --- a/src/plasp/pddl/Expression.cpp +++ b/src/plasp/pddl/Expression.cpp @@ -114,7 +114,7 @@ ExpressionPointer parseExpression(Context &context, ExpressionContext &expressio const auto expressionIdentifier = parser.parseIdentifier(isIdentifier); parser.seek(position); - throw utils::ParserException(context.parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); + throw utils::ParserException(context.parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -186,7 +186,7 @@ ExpressionPointer parseEffectBodyExpression(Context &context, ExpressionContext const auto expressionIdentifier = parser.parseIdentifier(isIdentifier); parser.seek(position); - throw utils::ParserException(context.parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); + throw utils::ParserException(context.parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -198,7 +198,7 @@ ExpressionPointer parsePredicate(Context &context, ExpressionContext &expression if ((expression = expressions::Predicate::parse(context, expressionContext))) return expression; - throw utils::ParserException(context.parser, "Expected predicate"); + throw utils::ParserException(context.parser, "expected predicate"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/plasp/pddl/InitialState.cpp b/src/plasp/pddl/InitialState.cpp index 7290d3d..e767249 100644 --- a/src/plasp/pddl/InitialState.cpp +++ b/src/plasp/pddl/InitialState.cpp @@ -59,7 +59,7 @@ std::unique_ptr InitialState::parseDeclaration(Context &context, const auto expressionIdentifier = parser.parseIdentifier(isIdentifier); parser.seek(position); - throw utils::ParserException(parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); + throw utils::ParserException(parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context"); }; parser.skipWhiteSpace(); diff --git a/src/plasp/pddl/Problem.cpp b/src/plasp/pddl/Problem.cpp index 6a76967..0b58e1c 100644 --- a/src/plasp/pddl/Problem.cpp +++ b/src/plasp/pddl/Problem.cpp @@ -53,7 +53,7 @@ void Problem::findSections() if (unique && sectionPosition != -1) { parser.seek(value); - throw utils::ParserException(parser, "Only one “:" + sectionName + "” section allowed"); + throw utils::ParserException(parser, "only one “:" + sectionName + "” section allowed"); } sectionPosition = value; @@ -89,7 +89,7 @@ void Problem::findSections() const auto sectionIdentifier = parser.parseIdentifier(isIdentifier); - m_context.logger.logWarning(parser, "Section type “" + sectionIdentifier + "” currently unsupported"); + m_context.logger.logWarning(parser, "section type “" + sectionIdentifier + "” currently unsupported"); parser.seek(sectionIdentifierPosition); } @@ -98,7 +98,7 @@ void Problem::findSections() const auto sectionIdentifier = parser.parseIdentifier(isIdentifier); parser.seek(position); - throw utils::ParserException(m_context.parser, "Unknown problem section “" + sectionIdentifier + "”"); + throw utils::ParserException(m_context.parser, "unknown problem section “" + sectionIdentifier + "”"); } // Skip section for now and parse it later @@ -117,7 +117,7 @@ void Problem::parse() auto &parser = m_context.parser; if (m_domainPosition == -1) - throw ConsistencyException("Problem description does not specify the corresponding domain"); + throw ConsistencyException("problem description does not specify the corresponding domain"); parser.seek(m_domainPosition); parseDomainSection(); @@ -135,13 +135,13 @@ void Problem::parse() } if (m_initialStatePosition == -1) - throw ConsistencyException("Problem description does not specify an initial state"); + throw ConsistencyException("problem description does not specify an initial state"); parser.seek(m_initialStatePosition); parseInitialStateSection(); if (m_goalPosition == -1) - throw ConsistencyException("Problem description does not specify a goal"); + throw ConsistencyException("problem description does not specify a goal"); parser.seek(m_goalPosition); parseGoalSection(); @@ -204,7 +204,7 @@ void Problem::parseDomainSection() const auto domainName = parser.parseIdentifier(isIdentifier); if (m_domain.name() != domainName) - throw utils::ParserException(parser, "Domains do not match (“" + m_domain.name() + "” and “" + domainName + "”)"); + throw utils::ParserException(parser, "domains do not match (“" + m_domain.name() + "” and “" + domainName + "”)"); parser.expect(")"); } @@ -261,7 +261,7 @@ void Problem::checkRequirement(Requirement::Type requirementType) const if (hasRequirement(requirementType)) return; - throw ConsistencyException("Requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); + throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/plasp/pddl/Requirement.cpp b/src/plasp/pddl/Requirement.cpp index 7583807..774d70e 100644 --- a/src/plasp/pddl/Requirement.cpp +++ b/src/plasp/pddl/Requirement.cpp @@ -89,12 +89,12 @@ Requirement Requirement::parse(Context &context) const auto match = requirementTypesToPDDL.right.find(requirementName); if (match == requirementTypesToPDDL.right.end()) - throw utils::ParserException(context.parser, "Unknown PDDL requirement “" + requirementName + "”"); + throw utils::ParserException(context.parser, "unknown PDDL requirement “" + requirementName + "”"); const auto requirementType = match->second; if (requirementType == Requirement::Type::GoalUtilities) - context.logger.logWarning(context.parser, "Requirement “goal-utilities” is not part of the PDDL 3.1 specification"); + context.logger.logWarning(context.parser, "requirement “goal-utilities” is not part of the PDDL 3.1 specification"); return Requirement(match->second); } diff --git a/src/plasp/pddl/TranslatorASP.cpp b/src/plasp/pddl/TranslatorASP.cpp index fe948b3..62f4213 100644 --- a/src/plasp/pddl/TranslatorASP.cpp +++ b/src/plasp/pddl/TranslatorASP.cpp @@ -221,7 +221,7 @@ void TranslatorASP::translateActions() const else { if (precondition.expressionType() != Expression::Type::And) - throw utils::TranslatorException("Only “and” expressions and (negated) predicates supported as action preconditions currently"); + throw utils::TranslatorException("only “and” expressions and (negated) predicates supported as action preconditions currently"); const auto &andExpression = dynamic_cast(precondition); @@ -247,7 +247,7 @@ void TranslatorASP::translateActions() const else { if (effect.expressionType() != Expression::Type::And) - throw utils::TranslatorException("Only “and” expressions and (negated) predicates supported as action effects currently"); + throw utils::TranslatorException("only “and” expressions and (negated) predicates supported as action effects currently"); const auto &andExpression = dynamic_cast(effect); @@ -342,7 +342,7 @@ void TranslatorASP::translateVariablesBody(const expressions::Variables &variabl if (variable.type() != nullptr) { if (variable.type()->expressionType() != Expression::Type::PrimitiveType) - throw utils::TranslatorException("Only primitive types supported currently"); + throw utils::TranslatorException("only primitive types supported currently"); const auto &type = *dynamic_cast(variable.type()); @@ -387,7 +387,7 @@ void TranslatorASP::translateLiteral(const Expression &literal) const printKeyword("false"); } else - throw utils::TranslatorException("Only primitive predicates and their negations supported as literals currently"); + throw utils::TranslatorException("only primitive predicates and their negations supported as literals currently"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -426,7 +426,7 @@ void TranslatorASP::translatePredicate(const expressions::Predicate &predicate) printVariable(utils::escapeASPVariable(variable.name())); } else - throw utils::TranslatorException("Only variables and constants supported in predicates currently"); + throw utils::TranslatorException("only variables and constants supported in predicates currently"); } m_outputStream << "))"; @@ -484,10 +484,10 @@ void TranslatorASP::translateInitialState() const const auto ¬Expression = dynamic_cast(*fact); if (notExpression.argument()->expressionType() != Expression::Type::Predicate) - throw utils::TranslatorException("Only negations of simple predicates supported in initial state currently"); + throw utils::TranslatorException("only negations of simple predicates supported in initial state currently"); } else - throw utils::TranslatorException("Only predicates and their negations supported in initial state currently"); + throw utils::TranslatorException("only predicates and their negations supported in initial state currently"); m_outputStream << ")."; }); @@ -533,7 +533,7 @@ void TranslatorASP::translateGoal() const }); } else - throw utils::TranslatorException("Only single predicates, their negations, and conjunctions are currently supported in the goal"); + throw utils::TranslatorException("only single predicates, their negations, and conjunctions are currently supported in the goal"); m_outputStream << std::endl; } diff --git a/src/plasp/pddl/expressions/Constant.cpp b/src/plasp/pddl/expressions/Constant.cpp index 2b4a4e1..8ae4d8d 100644 --- a/src/plasp/pddl/expressions/Constant.cpp +++ b/src/plasp/pddl/expressions/Constant.cpp @@ -113,7 +113,7 @@ void Constant::parseTypedDeclarations(Context &context, Domain &domain) domain.checkRequirement(Requirement::Type::Typing); // If no types are given, check that typing is not a requirement else if (domain.hasRequirement(Requirement::Type::Typing)) - throw utils::ParserException(parser, "Constant has undeclared type"); + throw utils::ParserException(parser, "constant has undeclared type"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -140,7 +140,7 @@ void Constant::parseTypedDeclarations(Context &context, Problem &problem) problem.checkRequirement(Requirement::Type::Typing); // If no types are given, check that typing is not a requirement else if (problem.hasRequirement(Requirement::Type::Typing)) - throw utils::ParserException(context.parser, "Constant has undeclared type"); + throw utils::ParserException(context.parser, "constant has undeclared type"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -156,7 +156,7 @@ Constant *Constant::parseAndFind(Context &context, const Domain &domain) if (constant != nullptr) return constant; - throw utils::ParserException(context.parser, "Constant “" + constantName + "” used but never declared"); + throw utils::ParserException(context.parser, "constant “" + constantName + "” used but never declared"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -177,7 +177,7 @@ Constant *Constant::parseAndFind(Context &context, const Problem &problem) if (constant) return constant; - throw utils::ParserException(context.parser, "Constant “" + constantName + "” used but never declared"); + throw utils::ParserException(context.parser, "constant “" + constantName + "” used but never declared"); } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/plasp/pddl/expressions/Predicate.cpp b/src/plasp/pddl/expressions/Predicate.cpp index ee4a314..6438992 100644 --- a/src/plasp/pddl/expressions/Predicate.cpp +++ b/src/plasp/pddl/expressions/Predicate.cpp @@ -127,7 +127,7 @@ PredicatePointer Predicate::parse(Context &context, const Problem &problem) while (context.parser.currentCharacter() != ')') { if (context.parser.currentCharacter() == '?') - throw utils::ParserException(context.parser, "Variables not allowed in this context"); + throw utils::ParserException(context.parser, "variables not allowed in this context"); // Parse objects and constants const auto *constant = Constant::parseAndFind(context, problem); diff --git a/src/plasp/pddl/expressions/PrimitiveType.cpp b/src/plasp/pddl/expressions/PrimitiveType.cpp index 5e55d39..850300a 100644 --- a/src/plasp/pddl/expressions/PrimitiveType.cpp +++ b/src/plasp/pddl/expressions/PrimitiveType.cpp @@ -109,7 +109,7 @@ PrimitiveType *PrimitiveType::parseAndFind(Context &context, Domain &domain) const auto typeName = context.parser.parseIdentifier(isIdentifier); if (typeName.empty()) - throw utils::ParserException(context.parser, "No type supplied"); + throw utils::ParserException(context.parser, "no type supplied"); const auto match = std::find_if(types.cbegin(), types.cend(), [&](const auto &primitiveType) @@ -122,11 +122,11 @@ PrimitiveType *PrimitiveType::parseAndFind(Context &context, Domain &domain) // Only "object" is allowed as an implicit type if (typeName == "object" || typeName == "objects") { - context.logger.logWarning(context.parser, "Primitive type “" + typeName + "” should be declared"); + context.logger.logWarning(context.parser, "primitive type “" + typeName + "” should be declared"); types.emplace_back(std::make_unique(typeName)); } else - throw utils::ParserException(context.parser, "Type “" + typeName + "” used but never declared"); + throw utils::ParserException(context.parser, "type “" + typeName + "” used but never declared"); return types.back().get(); } diff --git a/src/plasp/pddl/expressions/Unsupported.cpp b/src/plasp/pddl/expressions/Unsupported.cpp index 4072afa..19181bc 100644 --- a/src/plasp/pddl/expressions/Unsupported.cpp +++ b/src/plasp/pddl/expressions/Unsupported.cpp @@ -26,7 +26,7 @@ UnsupportedPointer Unsupported::parse(Context &context) expression->m_type = parser.parseIdentifier(isIdentifier); - context.logger.logWarning(context.parser, "Expression type “" + expression->m_type + "” currently unsupported in this context"); + context.logger.logWarning(context.parser, "expression type “" + expression->m_type + "” currently unsupported in this context"); skipSection(parser); diff --git a/src/plasp/pddl/expressions/Variable.cpp b/src/plasp/pddl/expressions/Variable.cpp index 571471e..7a7ed28 100644 --- a/src/plasp/pddl/expressions/Variable.cpp +++ b/src/plasp/pddl/expressions/Variable.cpp @@ -52,7 +52,7 @@ void Variable::parseDeclaration(Context &context, Variables ¶meters) }); if (match != parameters.cend()) - throw utils::ParserException(context.parser, "Variable “" + variable->m_name + "” already declared in this scope"); + throw utils::ParserException(context.parser, "variable “" + variable->m_name + "” already declared in this scope"); // Flag variable for potentially upcoming type declaration variable->setDirty(); @@ -132,7 +132,7 @@ void Variable::parseTypedDeclarations(Context &context, ExpressionContext &expre expressionContext.checkRequirement(Requirement::Type::Typing); // If no types are given, check that typing is not a requirement else if (expressionContext.hasRequirement(Requirement::Type::Typing)) - throw utils::ParserException(parser, "Variable has undeclared type"); + throw utils::ParserException(parser, "variable has undeclared type"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -154,7 +154,7 @@ const Variable *Variable::parseAndFind(Context &context, const ExpressionContext }); if (match == variables.cend()) - throw utils::ParserException(context.parser, "Parameter “" + variableName + "” used but never declared"); + throw utils::ParserException(context.parser, "parameter “" + variableName + "” used but never declared"); return match->get(); } diff --git a/src/plasp/sas/Description.cpp b/src/plasp/sas/Description.cpp index ced16d6..615c645 100644 --- a/src/plasp/sas/Description.cpp +++ b/src/plasp/sas/Description.cpp @@ -169,7 +169,7 @@ void Description::parseContent(utils::Parser &parser) parser.skipWhiteSpace(); if (!parser.atEndOfStream()) - throw utils::ParserException(parser, "Expected end of SAS description (perhaps, input contains two SAS descriptions?)"); + throw utils::ParserException(parser, "expected end of SAS description (perhaps, input contains two SAS descriptions?)"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -181,7 +181,7 @@ void Description::parseVersionSection(utils::Parser &parser) const const auto formatVersion = parser.parse(); if (formatVersion != 3) - throw utils::ParserException(parser, "Unsupported SAS format version (" + std::to_string(formatVersion) + ")"); + throw utils::ParserException(parser, "unsupported SAS format version (" + std::to_string(formatVersion) + ")"); parser.expect("end_version"); } diff --git a/src/plasp/sas/MutexGroup.cpp b/src/plasp/sas/MutexGroup.cpp index c2edf96..69b08b9 100644 --- a/src/plasp/sas/MutexGroup.cpp +++ b/src/plasp/sas/MutexGroup.cpp @@ -29,7 +29,7 @@ MutexGroup MutexGroup::fromSAS(utils::Parser &parser, const Variables &variables mutexGroup.m_facts.emplace_back(Fact::fromSAS(parser, variables)); if (mutexGroup.m_facts[j].value() == Value::None) - throw utils::ParserException(parser, "Mutex groups must not contain values"); + throw utils::ParserException(parser, "mutex groups must not contain values"); } parser.expect("end_mutex_group"); diff --git a/src/plasp/sas/Predicate.cpp b/src/plasp/sas/Predicate.cpp index 023d276..14ecf50 100644 --- a/src/plasp/sas/Predicate.cpp +++ b/src/plasp/sas/Predicate.cpp @@ -46,7 +46,7 @@ Predicate Predicate::fromSAS(utils::Parser &parser) } catch (const std::exception &e) { - throw utils::ParserException(parser, "Could not parse operator predicate"); + throw utils::ParserException(parser, "could not parse operator predicate"); } return predicate; diff --git a/src/plasp/sas/Value.cpp b/src/plasp/sas/Value.cpp index f3a29fe..f5ad4b6 100644 --- a/src/plasp/sas/Value.cpp +++ b/src/plasp/sas/Value.cpp @@ -74,7 +74,7 @@ Value Value::fromSAS(utils::Parser &parser) else if (sasSign == "NegatedAtom") value.m_sign = Value::Sign::Negative; else - throw utils::ParserException(parser, "Invalid value sign “" + sasSign + "”"); + throw utils::ParserException(parser, "invalid value sign “" + sasSign + "”"); try { @@ -90,7 +90,7 @@ Value Value::fromSAS(utils::Parser &parser) } catch (const std::exception &e) { - throw utils::ParserException(parser, std::string("Could not parse variable value (") + e.what() + ")"); + throw utils::ParserException(parser, std::string("could not parse variable value (") + e.what() + ")"); } return value; @@ -106,7 +106,7 @@ const Value &Value::referenceFromSAS(utils::Parser &parser, const Variable &vari return Value::Any; if (valueID < 0 || static_cast(valueID) >= variable.values().size()) - throw utils::ParserException(parser, "Value index out of range (variable " + variable.name() + ", index " + std::to_string(valueID) + ")"); + throw utils::ParserException(parser, "value index out of range (variable " + variable.name() + ", index " + std::to_string(valueID) + ")"); return variable.values()[valueID]; } diff --git a/src/plasp/sas/Variable.cpp b/src/plasp/sas/Variable.cpp index 9a9594d..48dc140 100644 --- a/src/plasp/sas/Variable.cpp +++ b/src/plasp/sas/Variable.cpp @@ -63,7 +63,7 @@ const Variable &Variable::referenceFromSAS(utils::Parser &parser, const Variable const auto variableID = parser.parse(); if (variableID >= variables.size()) - throw utils::ParserException(parser, "Variable index out of range (index " + std::to_string(variableID) + ")"); + throw utils::ParserException(parser, "variable index out of range (index " + std::to_string(variableID) + ")"); return variables[variableID]; } diff --git a/src/plasp/utils/Parser.cpp b/src/plasp/utils/Parser.cpp index 9a6ad85..a543c7a 100644 --- a/src/plasp/utils/Parser.cpp +++ b/src/plasp/utils/Parser.cpp @@ -186,7 +186,7 @@ bool Parser::atEndOfStream() const void Parser::checkStream() const { if (atEndOfStream()) - throw ParserException(*this, "Reading past end of file"); + throw ParserException(*this, "reading past end of file"); if (m_stream.fail()) throw ParserException(*this); @@ -310,7 +310,7 @@ template<> void Parser::expect(const std::string &expectedValue) { if (!probe(expectedValue)) - throw ParserException(*this, "Expected “" + expectedValue + "”"); + throw ParserException(*this, "expected “" + expectedValue + "”"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -344,7 +344,7 @@ template<> void Parser::expect(const char &expectedValue) { if (!probe(expectedValue)) - throw ParserException(*this, std::string("Expected “") + expectedValue + "”"); + throw ParserException(*this, std::string("expected “") + expectedValue + "”"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -354,7 +354,7 @@ uint64_t Parser::parseIntegerBody() checkStream(); if (!std::isdigit(currentCharacter())) - throw ParserException(*this, "Could not parse integer value"); + throw ParserException(*this, "could not parse integer value"); uint64_t value = 0; @@ -396,7 +396,7 @@ uint64_t Parser::parse() skipWhiteSpace(); if (currentCharacter() == '-') - throw ParserException(*this, "Expected unsigned integer, got signed one"); + throw ParserException(*this, "expected unsigned integer, got signed one"); return parseIntegerBody(); } @@ -439,7 +439,7 @@ template<> void Parser::expect(const int64_t &expectedValue) { if (!probe(expectedValue)) - throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "”"); + throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "”"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -448,7 +448,7 @@ template<> void Parser::expect(const uint64_t &expectedValue) { if (!probe(expectedValue)) - throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "”"); + throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "”"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -512,7 +512,7 @@ bool Parser::parse() if (probe('1')) return true; - throw ParserException(*this, "Could not parse Boolean value"); + throw ParserException(*this, "could not parse Boolean value"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -523,7 +523,7 @@ void Parser::expect(const bool &expectedValue) const auto value = parse(); if (value != expectedValue) - throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "”"); + throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "”"); } ////////////////////////////////////////////////////////////////////////////////////////////////////