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
26a7221c
Commit
26a7221c
authored
Mar 02, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of top-level config values
parent
20b62978
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
libcaf_core/caf/detail/parser/read_ini.hpp
libcaf_core/caf/detail/parser/read_ini.hpp
+5
-2
libcaf_core/src/ini_consumer.cpp
libcaf_core/src/ini_consumer.cpp
+7
-2
libcaf_core/test/ini_consumer.cpp
libcaf_core/test/ini_consumer.cpp
+2
-2
No files found.
libcaf_core/caf/detail/parser/read_ini.hpp
View file @
26a7221c
...
@@ -266,7 +266,7 @@ void read_ini(state<Iterator, Sentinel>& ps, Consumer&& consumer) {
...
@@ -266,7 +266,7 @@ void read_ini(state<Iterator, Sentinel>& ps, Consumer&& consumer) {
transition
(
init
,
"
\t\n
"
)
transition
(
init
,
"
\t\n
"
)
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
init
,
';'
)
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
init
,
';'
)
transition
(
start_section
,
'['
)
transition
(
start_section
,
'['
)
fsm_epsilon_if
(
tmp
==
"global"
,
read_ini_section
(
ps
,
begin_section
()),
init
)
fsm_epsilon_if
(
tmp
==
"global"
,
read_ini_section
(
ps
,
begin_section
()),
return_to_global
)
}
}
// Read the section key after reading an '['.
// Read the section key after reading an '['.
state
(
start_section
)
{
state
(
start_section
)
{
...
@@ -281,7 +281,10 @@ void read_ini(state<Iterator, Sentinel>& ps, Consumer&& consumer) {
...
@@ -281,7 +281,10 @@ void read_ini(state<Iterator, Sentinel>& ps, Consumer&& consumer) {
// Wait for the closing ']', preceded by any number of whitespaces.
// Wait for the closing ']', preceded by any number of whitespaces.
state
(
close_section
)
{
state
(
close_section
)
{
transition
(
close_section
,
"
\t
"
)
transition
(
close_section
,
"
\t
"
)
fsm_transition
(
read_ini_section
(
ps
,
begin_section
()),
init
,
']'
)
fsm_transition
(
read_ini_section
(
ps
,
begin_section
()),
return_to_global
,
']'
)
}
unstable_state
(
return_to_global
)
{
epsilon
(
init
,
any_char
,
tmp
=
"global"
)
}
}
fin
();
fin
();
}
}
...
...
libcaf_core/src/ini_consumer.cpp
View file @
26a7221c
...
@@ -188,8 +188,13 @@ void ini_consumer::value_impl(config_value&& x) {
...
@@ -188,8 +188,13 @@ void ini_consumer::value_impl(config_value&& x) {
std
::
string
prev_key
;
std
::
string
prev_key
;
swap
(
current_key_
,
prev_key
);
swap
(
current_key_
,
prev_key
);
for
(
auto
&
entry
:
*
dict
)
{
for
(
auto
&
entry
:
*
dict
)
{
current_key_
=
std
::
move
(
entry
.
first
);
if
(
holds_alternative
<
dict_type
>
(
entry
.
second
))
{
value_impl
(
std
::
move
(
entry
.
second
));
// Recurse into top-level maps.
current_key_
=
std
::
move
(
entry
.
first
);
value_impl
(
std
::
move
(
entry
.
second
));
}
else
{
cfg_
.
insert_or_assign
(
entry
.
first
,
std
::
move
(
entry
.
second
));
}
}
}
swap
(
prev_key
,
current_key_
);
swap
(
prev_key
,
current_key_
);
}
}
...
...
libcaf_core/test/ini_consumer.cpp
View file @
26a7221c
...
@@ -46,15 +46,15 @@ impl = 'foo';some atom
...
@@ -46,15 +46,15 @@ impl = 'foo';some atom
const
char
test_ini2
[]
=
R"(
const
char
test_ini2
[]
=
R"(
is_server = true
is_server = true
port = 4242
nodes = ["sun", "venus"]
logger = {
logger = {
file-name = "foobar.ini"
file-name = "foobar.ini"
}
}
port = 4242
scheduler = {
scheduler = {
timing = 2us,
timing = 2us,
impl = 'foo'
impl = 'foo'
}
}
nodes = ["sun", "venus"]
)"
;
)"
;
struct
fixture
{
struct
fixture
{
...
...
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