Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
6ecfdc74
Commit
6ecfdc74
authored
Mar 23, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer 'invalid' over 'illegal' in enum constants
parent
8ccf92c9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
13 deletions
+18
-13
CHANGELOG.md
CHANGELOG.md
+5
-0
libcaf_core/caf/detail/config_value_field_base.hpp
libcaf_core/caf/detail/config_value_field_base.hpp
+1
-1
libcaf_core/caf/detail/parser/read_string.hpp
libcaf_core/caf/detail/parser/read_string.hpp
+1
-1
libcaf_core/caf/pec.hpp
libcaf_core/caf/pec.hpp
+3
-3
libcaf_core/src/config_option_set.cpp
libcaf_core/src/config_option_set.cpp
+2
-2
libcaf_core/src/pec_strings.cpp
libcaf_core/src/pec_strings.cpp
+6
-6
No files found.
CHANGELOG.md
View file @
6ecfdc74
...
...
@@ -77,6 +77,11 @@ is based on [Keep a Changelog](https://keepachangelog.com).
argument). Furthermore, the state class can now provide a
`make_behavior`
member function to initialize the actor (this has no effect for function-based
actors).
-
In order to stay more consistent with naming conventions of the standard
library, we have renamed some values of the
`pec`
enumeration:
+
`illegal_escape_sequence`
=>
`invalid_escape_sequence`
+
`illegal_argument`
=>
`invalid_argument`
+
`illegal_category`
=>
`invalid_category`
### Removed
...
...
libcaf_core/caf/detail/config_value_field_base.hpp
View file @
6ecfdc74
...
...
@@ -87,7 +87,7 @@ public:
dispatch_parse_cli
(
ps
,
tmp
,
char_blacklist
);
if
(
ps
.
code
<=
pec
::
trailing_character
)
{
if
(
predicate_
&&
!
predicate_
(
tmp
))
ps
.
code
=
pec
::
i
llegal
_argument
;
ps
.
code
=
pec
::
i
nvalid
_argument
;
else
set_value
(
x
,
std
::
move
(
tmp
));
}
...
...
libcaf_core/caf/detail/parser/read_string.hpp
View file @
6ecfdc74
...
...
@@ -60,7 +60,7 @@ void read_string(State& ps, Consumer&& consumer) {
transition
(
read_chars
,
't'
,
res
+=
'\t'
)
transition
(
read_chars
,
'\\'
,
res
+=
'\\'
)
transition
(
read_chars
,
'"'
,
res
+=
'"'
)
error_transition
(
pec
::
i
llegal
_escape_sequence
)
error_transition
(
pec
::
i
nvalid
_escape_sequence
)
}
term_state
(
read_unquoted_chars
)
{
transition
(
read_unquoted_chars
,
alphanumeric_chars
,
res
+=
ch
)
...
...
libcaf_core/caf/pec.hpp
View file @
6ecfdc74
...
...
@@ -45,7 +45,7 @@ enum class pec : uint8_t {
/// Too many characters for an atom.
too_many_characters
,
/// Unrecognized character after escaping `\`.
i
llegal
_escape_sequence
,
i
nvalid
_escape_sequence
,
/// Misplaced newline, e.g., inside a string.
unexpected_newline
,
/// Parsed positive integer exceeds the number of available bits.
...
...
@@ -61,11 +61,11 @@ enum class pec : uint8_t {
/// Stopped at an unrecognized option name.
not_an_option
,
/// Stopped at an unparsable argument.
i
llegal
_argument
=
15
,
i
nvalid
_argument
=
15
,
/// Stopped because an argument was omitted.
missing_argument
,
/// Stopped because the key of a category was taken.
i
llegal
_category
,
i
nvalid
_category
,
/// Stopped at an unexpected field name while reading a user-defined type.
invalid_field_name
,
/// Stopped at a repeated field name while reading a user-defined type.
...
...
libcaf_core/src/config_option_set.cpp
View file @
6ecfdc74
...
...
@@ -145,7 +145,7 @@ auto config_option_set::parse(settings& config, argument_iterator first,
// Flags only consume the current element.
if
(
opt
.
is_flag
())
{
if
(
arg_begin
!=
arg_end
)
return
pec
::
i
llegal
_argument
;
return
pec
::
i
nvalid
_argument
;
config_value
cfg_true
{
true
};
opt
.
store
(
cfg_true
);
entry
[
opt_name
]
=
cfg_true
;
...
...
@@ -159,7 +159,7 @@ auto config_option_set::parse(settings& config, argument_iterator first,
auto
&
err
=
val
.
error
();
if
(
err
.
category
()
==
error_category
<
pec
>::
value
)
return
static_cast
<
pec
>
(
err
.
code
());
return
pec
::
i
llegal
_argument
;
return
pec
::
i
nvalid
_argument
;
}
entry
[
opt_name
]
=
std
::
move
(
*
val
);
}
...
...
libcaf_core/src/pec_strings.cpp
View file @
6ecfdc74
...
...
@@ -25,8 +25,8 @@ std::string to_string(pec x) {
return
"fractional_timespan"
;
case
pec
:
:
too_many_characters
:
return
"too_many_characters"
;
case
pec
:
:
i
llegal
_escape_sequence
:
return
"i
llegal
_escape_sequence"
;
case
pec
:
:
i
nvalid
_escape_sequence
:
return
"i
nvalid
_escape_sequence"
;
case
pec
:
:
unexpected_newline
:
return
"unexpected_newline"
;
case
pec
:
:
integer_overflow
:
...
...
@@ -41,12 +41,12 @@ std::string to_string(pec x) {
return
"type_mismatch"
;
case
pec
:
:
not_an_option
:
return
"not_an_option"
;
case
pec
:
:
i
llegal
_argument
:
return
"i
llegal
_argument"
;
case
pec
:
:
i
nvalid
_argument
:
return
"i
nvalid
_argument"
;
case
pec
:
:
missing_argument
:
return
"missing_argument"
;
case
pec
:
:
i
llegal
_category
:
return
"i
llegal
_category"
;
case
pec
:
:
i
nvalid
_category
:
return
"i
nvalid
_category"
;
case
pec
:
:
invalid_field_name
:
return
"invalid_field_name"
;
case
pec
:
:
repeated_field_name
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment