Rework x3::phrase_parse into x3::parse
For commands, there is predefined places where we want to skip spaces:
on the start of the command, in between command arguments and at the
end of the command. Using phrase_parse just makes everything more
complicated, since I have to actually disable space skipping a lot of
the time.
For ls: the ">>" did unexpected stuff, because for example this input:
> ls foo
could fail if "foo" wasn't a valid node. However, because the ls path
argument is wrapped in in the optional parser, it would still parse it as
valid.
For get: same as ls.
Change-Id: I90b32e1a270da0c228691935cc7206d73248025a
diff --git a/src/path_parser.hpp b/src/path_parser.hpp
index 1800ffa..638feeb 100644
--- a/src/path_parser.hpp
+++ b/src/path_parser.hpp
@@ -364,9 +364,7 @@
'[' >> leaf_data >> suggestLeafListEnd >> ']';
auto const key_identifier_def =
- x3::lexeme[
- ((x3::alpha | char_("_")) >> *(x3::alnum | char_("_") | char_("-") | char_(".")))
- ];
+ ((x3::alpha | char_("_")) >> *(x3::alnum | char_("_") | char_("-") | char_(".")));
auto const createKeySuggestions_def =
x3::eps;
@@ -381,7 +379,7 @@
key_identifier > '=' > createValueSuggestions > leaf_data;
auto const keyValueWrapper =
- x3::no_skip['[' > createKeySuggestions > keyValue > suggestKeysEnd > ']'];
+ '[' > createKeySuggestions > keyValue > suggestKeysEnd > ']';
// even though we don't allow no keys to be supplied, the star allows me to check which keys are missing
auto const listSuffix_def =
@@ -394,7 +392,7 @@
x3::omit['/'] >> x3::attr(Scope::Absolute);
auto const trailingSlash_def =
- x3::no_skip[x3::omit['/']];
+ x3::omit['/'];
auto const filterConfigFalse = [](const Schema& schema, const std::string& path) {
return schema.isConfig(path);