Disable space skipping in argument of set
Change-Id: I9eb955c30ba06071fb36c3bb54001d53c4c7dd26
Bug: https://tree.taiga.io/project/jktjkt-netconf-cli/issue/148
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 871d3c0..9f50634 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -273,7 +273,7 @@
createIdentitySuggestions >> leaf_data_identityRef_data;
auto const leaf_data_def =
-x3::expect[
+x3::no_skip[x3::expect[
leaf_data_enum |
leaf_data_decimal |
leaf_data_bool |
@@ -287,7 +287,7 @@
leaf_data_uint64 |
leaf_data_binary |
leaf_data_identityRef |
- leaf_data_string];
+ leaf_data_string]];
struct ls_options_table : x3::symbols<LsOption> {
ls_options_table()
diff --git a/tests/leaf_editing.cpp b/tests/leaf_editing.cpp
index bcf06aa..ca9a5da 100644
--- a/tests/leaf_editing.cpp
+++ b/tests/leaf_editing.cpp
@@ -73,6 +73,14 @@
expected.m_data = std::string("more_data");
}
+ SECTION("set mod:contA/leafInCont more d\tata") // spaces in string
+ {
+ input = "set mod:contA/leafInCont more d\tata";
+ expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
+ expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")});
+ expected.m_data = std::string("more d\tata");
+ }
+
SECTION("set mod:list[number=1]/leafInList another_data")
{
input = "set mod:list[number=1]/leafInList another_data";