Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
873869c0
Commit
873869c0
authored
May 19, 2022
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Simplify error message
parent
09e7743a
No related branches found
No related tags found
1 merge request
!145
git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/language/ast/ASTNodeIncDecExpressionBuilder.cpp
+1
-1
1 addition, 1 deletion
src/language/ast/ASTNodeIncDecExpressionBuilder.cpp
tests/test_ASTNodeIncDecExpressionBuilder.cpp
+17
-18
17 additions, 18 deletions
tests/test_ASTNodeIncDecExpressionBuilder.cpp
with
18 additions
and
19 deletions
src/language/ast/ASTNodeIncDecExpressionBuilder.cpp
+
1
−
1
View file @
873869c0
...
...
@@ -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
variable
s
"
;
error_message
<<
"invalid operand type
, expecting a
variable"
;
throw
ParseError
(
error_message
.
str
(),
std
::
vector
{
n
.
children
[
0
]
->
begin
()});
}
...
...
This diff is collapsed.
Click to expand it.
tests/test_ASTNodeIncDecExpressionBuilder.cpp
+
17
−
18
View file @
873869c0
...
...
@@ -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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
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
variable
s
)"
;
std
::
string
error_message
=
R"(invalid operand type
, expecting a
variable)"
;
DISALLOWED_CHAINED_AST
(
data
,
error_message
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment