Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-07-14 22:29:00


Author: hkaiser
Date: 2008-07-14 22:29:00 EDT (Mon, 14 Jul 2008)
New Revision: 47430
URL: http://svn.boost.org/trac/boost/changeset/47430

Log:
Spirit.Lex: Fixed strip_comments example
Text files modified:
   trunk/libs/spirit/doc/spirit2.qbk | 2 +-
   trunk/libs/spirit/example/lex/strip_comments.cpp | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/libs/spirit/doc/spirit2.qbk
==============================================================================
--- trunk/libs/spirit/doc/spirit2.qbk (original)
+++ trunk/libs/spirit/doc/spirit2.qbk 2008-07-14 22:29:00 EDT (Mon, 14 Jul 2008)
@@ -86,7 +86,7 @@
 [/ References to API descriptions ]
 
 [def __api_tokenize_and_parse__ [link spirit.qi_and_karma.abstracts.parsing_and_generating.the_tokenize_and_phrase_parse___function `tokenize_and_parse()`]]
-[def __api_generate_static__ [link spirit.__lex__.abstracts.tokenizing_input_data.the_generate_static___function `generate_static()`]]
+[def __api_generate_static__ [link spirit.lex.abstracts.tokenizing_input_data.the_generate_static___function `generate_static()`]]
 
 
 [/ References to classes ]

Modified: trunk/libs/spirit/example/lex/strip_comments.cpp
==============================================================================
--- trunk/libs/spirit/example/lex/strip_comments.cpp (original)
+++ trunk/libs/spirit/example/lex/strip_comments.cpp 2008-07-14 22:29:00 EDT (Mon, 14 Jul 2008)
@@ -65,7 +65,7 @@
     void def (Self& self)
     {
         // define tokens and associate them with the lexer
- cppcomment = "//.*\n";
+ cppcomment = "//[^\n]*";
         ccomment = "/\\*";
         endcomment = "\\*/";
         
@@ -111,7 +111,7 @@
                               *token(IDANY) >> tok.endcomment
                           ]
                   | tok.cppcomment
- | token(IDANY)
+ | token(IDANY) [ std::cout << _1 ]
                   )
               ;
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk