Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54791 - trunk/libs/spirit/test/lex
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-08 09:01:11


Author: hkaiser
Date: 2009-07-08 09:01:10 EDT (Wed, 08 Jul 2009)
New Revision: 54791
URL: http://svn.boost.org/trac/boost/changeset/54791

Log:
Spirit: added lexer testcase exhibiting a problem in current code
Text files modified:
   trunk/libs/spirit/test/lex/set_token_value.cpp | 25 +++++++++++++++++++++++++
   1 files changed, 25 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/test/lex/set_token_value.cpp
==============================================================================
--- trunk/libs/spirit/test/lex/set_token_value.cpp (original)
+++ trunk/libs/spirit/test/lex/set_token_value.cpp 2009-07-08 09:01:10 EDT (Wed, 08 Jul 2009)
@@ -250,6 +250,31 @@
         BOOST_TEST(test_tokens(d, tokens));
     }
 
+ // test two dedents, currently triggers a possible problem in regex engine
+ {
+ set_token_value<lexer_type> lexer;
+ std::vector<token_type> tokens;
+ std::string input(
+ "\n"
+ " \n"
+ " \n"
+ "\n");
+ base_iterator_type first = input.begin();
+
+ using phoenix::arg_names::_1;
+ BOOST_TEST(lex::tokenize(first, input.end(), lexer
+ , phoenix::push_back(phoenix::ref(tokens), _1)));
+
+ int i[] = { 4, -1 };
+ BOOST_TEST(test_indents(i, lexer.indents));
+
+ token_data d[] = {
+ { ID_INDENT, 1 }, { ID_INDENT, 1 }, { ID_INDENT, 1 }
+ , { ID_DEDENT, 2 }
+ , { -1, 0 } };
+ BOOST_TEST(test_tokens(d, tokens));
+ }
+
     return boost::report_errors();
 }
 


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