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

fix FormalRegExp Simplify

parent d055c4e6
No related branches found
No related tags found
1 merge request!106Master merge jt
...@@ -216,7 +216,7 @@ bool RegExpOptimize::A4( FormalRegExpElement < SymbolType > * & node ) { ...@@ -216,7 +216,7 @@ bool RegExpOptimize::A4( FormalRegExpElement < SymbolType > * & node ) {
template < class SymbolType > template < class SymbolType >
bool RegExpOptimize::A5( FormalRegExpElement < SymbolType > * & node ) { bool RegExpOptimize::A5( FormalRegExpElement < SymbolType > * & node ) {
FormalRegExpConcatenation < SymbolType > * n = dynamic_cast<FormalRegExpConcatenation < SymbolType > *>( node ); FormalRegExpConcatenation < SymbolType > * n = dynamic_cast<FormalRegExpConcatenation < SymbolType > *>( node );
if( ! node ) return false; if( ! n ) return false;
   
if( dynamic_cast < FormalRegExpConcatenation < SymbolType > * > ( & n->getLeft ( ) ) ) { if( dynamic_cast < FormalRegExpConcatenation < SymbolType > * > ( & n->getLeft ( ) ) ) {
FormalRegExpConcatenation < SymbolType > leftCon ( std::move ( static_cast < FormalRegExpConcatenation < SymbolType > & > ( n->getLeft ( ) ) ) ); FormalRegExpConcatenation < SymbolType > leftCon ( std::move ( static_cast < FormalRegExpConcatenation < SymbolType > & > ( n->getLeft ( ) ) ) );
...@@ -246,13 +246,13 @@ bool RegExpOptimize::A6( FormalRegExpElement < SymbolType > * & node ) { ...@@ -246,13 +246,13 @@ bool RegExpOptimize::A6( FormalRegExpElement < SymbolType > * & node ) {
   
if ( dynamic_cast < FormalRegExpEpsilon < SymbolType > * > ( & n->getRight ( ) ) ) { if ( dynamic_cast < FormalRegExpEpsilon < SymbolType > * > ( & n->getRight ( ) ) ) {
node = std::move ( n->getLeft ( ) ).clone ( ); node = std::move ( n->getLeft ( ) ).clone ( );
delete node; delete n;
return true; return true;
} }
   
if ( dynamic_cast < FormalRegExpEpsilon < SymbolType > * > ( & n->getLeft ( ) ) ) { if ( dynamic_cast < FormalRegExpEpsilon < SymbolType > * > ( & n->getLeft ( ) ) ) {
node = std::move ( n->getRight ( ) ).clone ( ); node = std::move ( n->getRight ( ) ).clone ( );
delete node; delete n;
return true; return true;
} }
   
......
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