Utils/Console: Add support for quoted path components
[senf.git] / senf / Utils / Console / Parse.ih
index 1fd7d2d..fffaec2 100644 (file)
@@ -150,10 +150,10 @@ namespace detail {
                                                  boost_spirit::rule<Scanner>,
                                                  boost_spirit::rule<Scanner> >
         {
-            boost_spirit::rule<Scanner> command, path, argument, word, string, hexstring, token,
-                punctuation, hexbyte, balanced_tokens, simple_argument, complex_argument, builtin,
-                skip, statement, relpath, abspath, arguments, group_start, group_close,
-                statement_end, opt_path;
+            boost_spirit::rule<Scanner> command, path, argument, word, string, hexstring,
+                word_or_string, token, punctuation, hexbyte, balanced_tokens, simple_argument,
+                complex_argument, builtin, skip, statement, relpath, abspath, arguments,
+                group_start, group_close, statement_end, opt_path;
 
             definition(CommandGrammar const & self)
             {
@@ -307,7 +307,7 @@ namespace detail {
                     ;
 
                 relpath
-                    =    (   word                 [ push_back(path_, token_) ]
+                    =    (   word_or_string       [ push_back(path_, token_) ]
                            % +ch_p('/') )
                       >> ( ! (+ch_p('/') )        [ push_back(path_, construct_<Token>()) ] )
                     ;
@@ -375,6 +375,11 @@ namespace detail {
                                                         pos_) ]
                     ;
 
+                word_or_string
+                    =    word
+                    |    string
+                    ;
+
                 hexbyte
                     =    uint_parser<char, 16, 2, 2>()
                                                   [ push_back(str_, arg1) ]