From 13f9af564d309e796338f69f6b01c903b22146c5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 13 Aug 2002 11:47:41 +0000 Subject: [PATCH] Added some new state information for forthcomming new algorithms. [SVN r14808] --- include/boost/regex/detail/regex_compile.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/regex/detail/regex_compile.hpp b/include/boost/regex/detail/regex_compile.hpp index 5ec6a262..a8613433 100644 --- a/include/boost/regex/detail/regex_compile.hpp +++ b/include/boost/regex/detail/regex_compile.hpp @@ -416,6 +416,17 @@ void BOOST_REGEX_CALL reg_expression::compile_maps() record->can_be_null = 0; compile_map(record->next.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_take, static_cast(record)->alt.p); compile_map(static_cast(record)->alt.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_skip); + if(record->type == re_detail::syntax_element_rep) + { + re_detail::re_repeat* rep = static_cast(record); + // set whether this is a singleton repeat or not: + if(rep->next.p->next.p->next.p == rep->alt.p) + { + rep->singleton = true; + } + else + rep->singleton = false; + } } else {