Suggest characters at ends of path fragments
The program now suggests a slash for containers, a space for leafs and a
left bracket for lists. The logic for suggesting the first the starting
bracket for lists got a little bit simplified, since it's now a part of
the list's identifier. The CLI now directly shows, if a
slash/bracket/space is going to be appended. The user can use this
information to deduce if a node is container/list/leaf.
Change-Id: Ib1a3cdd326a1451ba80f3bb48a9e8bdd13c102ae
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 4fd7b15..0a259b8 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -71,7 +71,6 @@
x3::rule<initializePath_class, x3::unused_type> const initializePath = "initializePath";
x3::rule<createPathSuggestions_class, x3::unused_type> const createPathSuggestions = "createPathSuggestions";
x3::rule<createKeySuggestions_class, x3::unused_type> const createKeySuggestions = "createKeySuggestions";
-x3::rule<suggestKeysStart_class, x3::unused_type> const suggestKeysStart = "suggestKeysStart";
x3::rule<suggestKeysEnd_class, x3::unused_type> const suggestKeysEnd = "suggestKeysEnd";
x3::rule<createCommandSuggestions_class, x3::unused_type> const createCommandSuggestions = "createCommandSuggestions";
x3::rule<completing_class, x3::unused_type> const completing = "completing";
@@ -118,9 +117,6 @@
auto const createKeySuggestions_def =
x3::eps;
-auto const suggestKeysStart_def =
- x3::eps;
-
auto const suggestKeysEnd_def =
x3::eps;
@@ -148,7 +144,7 @@
*keyValueWrapper;
auto const listElement_def =
- listPrefix >> -(!char_('[') >> suggestKeysStart) >> &char_('[') > listSuffix;
+ listPrefix >> &char_('[') > listSuffix;
auto const list_def =
node_identifier >> !char_('[');
@@ -405,7 +401,6 @@
BOOST_SPIRIT_DEFINE(command)
BOOST_SPIRIT_DEFINE(createPathSuggestions)
BOOST_SPIRIT_DEFINE(createKeySuggestions)
-BOOST_SPIRIT_DEFINE(suggestKeysStart)
BOOST_SPIRIT_DEFINE(suggestKeysEnd)
BOOST_SPIRIT_DEFINE(createCommandSuggestions)
BOOST_SPIRIT_DEFINE(completing)