Skip to content
Snippets Groups Projects
Commit 873869c0 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Simplify error message

parent 09e7743a
No related branches found
No related tags found
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
......@@ -11,7 +11,7 @@ ASTNodeIncDecExpressionBuilder::ASTNodeIncDecExpressionBuilder(ASTNode& n)
if (not n.children[0]->is_type<language::name>()) {
std::ostringstream error_message;
error_message << "invalid operand type. ++/-- operators only apply to variables";
error_message << "invalid operand type, expecting a variable";
throw ParseError(error_message.str(), std::vector{n.children[0]->begin()});
}
......
......@@ -323,8 +323,7 @@ x--;
ast->children.emplace_back(std::make_unique<ASTNode>());
REQUIRE_THROWS_WITH(ASTNodeIncDecExpressionBuilder{*ast},
"invalid operand type. ++/-- operators only apply to variables");
REQUIRE_THROWS_WITH(ASTNodeIncDecExpressionBuilder{*ast}, "invalid operand type, expecting a variable");
}
SECTION("Invalid data type")
......@@ -346,7 +345,7 @@ x--;
1 ++ ++;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -357,7 +356,7 @@ x--;
1 ++ --;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -368,7 +367,7 @@ x--;
1 -- ++;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -379,7 +378,7 @@ x--;
1 -- --;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -390,7 +389,7 @@ x--;
++ ++ 1;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -401,7 +400,7 @@ x--;
++ -- 1;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -412,7 +411,7 @@ x--;
-- ++ 1;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -423,7 +422,7 @@ x--;
-- -- 1;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -434,7 +433,7 @@ x--;
++ (1 ++);
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -445,7 +444,7 @@ x--;
++ (1 --);
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -456,7 +455,7 @@ x--;
-- (1 ++);
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -467,7 +466,7 @@ x--;
-- (1 --);
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -478,7 +477,7 @@ x--;
(++ 1) ++;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -489,7 +488,7 @@ x--;
(++ 1) --;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -500,7 +499,7 @@ x--;
(-- 1) ++;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......@@ -511,7 +510,7 @@ x--;
(-- 1) --;
)";
std::string error_message = R"(invalid operand type. ++/-- operators only apply to variables)";
std::string error_message = R"(invalid operand type, expecting a variable)";
DISALLOWED_CHAINED_AST(data, error_message)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment