Fix sample bootstrap senfutil.py (Examples/Sniffer/site_scons/senfutil.py)
[senf.git] / senf / Utils / Console / Parse.ih
index 1fd7d2d..baedd18 100644 (file)
@@ -44,7 +44,7 @@
 
 #include <senf/Utils/Phoenix.hh>
 
-///////////////////////////////ih.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace senf {
 namespace console {
@@ -82,18 +82,18 @@ namespace detail {
 
     ::phoenix::function<PositionOf> const positionOf;
 
-    ///////////////////////////////////////////////////////////////////////////
+    //-/////////////////////////////////////////////////////////////////////////////////////////////
     // Grammar
 
     template <class ParseDispatcher>
     struct CommandGrammar : boost_spirit::grammar<CommandGrammar<ParseDispatcher> >
     {
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // Start rules
 
         enum { CommandParser, SkipParser, ArgumentsParser, PathParser };
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // The parse context (variables needed while parsing)
 
         typedef Token::TokenType TokenType;
@@ -108,17 +108,17 @@ namespace detail {
 
         Context & context;
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // Configuration
 
         bool incremental;
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // Dispatching semantic actions
 
         ParseDispatcher & dispatcher;
 
-        //////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // charachter sets
 
         static boost_spirit::chset<> special_p;
@@ -128,7 +128,7 @@ namespace detail {
         static boost_spirit::chset<> word_p;
         static boost_spirit::distinct_parser<> keyword_p;
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
         // Errors
 
         enum Errors {
@@ -138,7 +138,7 @@ namespace detail {
             QuoteExpected
         };
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-/////////////////////////////////////////////////////////////////////////////////////////
 
         CommandGrammar(ParseDispatcher & d, Context & c)
             : context(c), incremental(false), dispatcher(d) {}
@@ -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)
             {
@@ -174,7 +174,7 @@ namespace detail {
                 assertion<Errors> closing_paren_expected      (ClosingParenExpected);
                 assertion<Errors> quote_expected              (QuoteExpected);
 
-                ///////////////////////////////////////////////////////////////////
+                //-/////////////////////////////////////////////////////////////////////////////////
                 // Spirit grammar
                 //
                 // Syntax summary:
@@ -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) ]
@@ -394,7 +399,7 @@ namespace detail {
                     =    self.space_p | comment_p('#')
                     ;
 
-                ///////////////////////////////////////////////////////////////////
+                //-/////////////////////////////////////////////////////////////////////////////////
 
                 start_parsers(
                     command,            // CommandParser
@@ -442,7 +447,7 @@ namespace detail {
 
 }}}
 
-///////////////////////////////ih.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 #endif
 
 \f