Skip to content
Snippets Groups Projects
Commit 098bf208 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add optimisation \e* -> \e to FormalRegExpOptimize

parent 6268d024
No related branches found
No related tags found
No related merge requests found
......@@ -402,6 +402,7 @@ bool RegExpOptimize::A11( FormalRegExpElement * & n ) const {
 
/**
* optimization V1: \0* = \e
* optimization T1: \e* = \e
* @param node FormalRegExpElement node
* @return bool true if optimization applied else false
*/
......@@ -414,6 +415,11 @@ bool RegExpOptimize::V1( FormalRegExpElement * & n ) const {
n = new FormalRegExpEpsilon( );
return true;
}
if( dynamic_cast<FormalRegExpEpsilon*>( node->getChild ( ).get() ) ) {
delete node;
n = new FormalRegExpEpsilon( );
return true;
}
return false;
}
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment