| 156 | } |
| 157 | |
| 158 | bool PatternMatcher::Match::subst( std::string& res ) { |
| 159 | if ( !matches() ) { |
| 160 | res.append( mString ); |
| 161 | return false; |
| 162 | } |
| 163 | int start = 0, end = 0; |
| 164 | mState->range( 0, start, end ); |
| 165 | if ( start == 0 ) |
| 166 | return true; |
| 167 | res.append( mString, start ); |
| 168 | return true; |
| 169 | } |
| 170 | |
| 171 | PatternMatcher::Match PatternMatcher::gmatch( const char* s ) & { |
| 172 | return PatternMatcher::Match( *this, s, false ); |