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

fix LeftRG constraint checks

parent 1fb18c8c
No related branches found
No related tags found
No related merge requests found
...@@ -518,7 +518,7 @@ public: ...@@ -518,7 +518,7 @@ public:
static bool used ( const grammar::LeftRG < SymbolType > & grammar, const SymbolType & symbol ) { static bool used ( const grammar::LeftRG < SymbolType > & grammar, const SymbolType & symbol ) {
for ( const std::pair < const SymbolType, ext::set < ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > > > & rule : grammar.getRules ( ) ) for ( const std::pair < const SymbolType, ext::set < ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > > > & rule : grammar.getRules ( ) )
for ( const ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > & rhs : rule.second ) for ( const ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > & rhs : rule.second )
if ( ( rhs.template is < SymbolType > ( ) && ( rhs.template get < SymbolType > ( ) == symbol ) ) || ( rhs.template get < ext::pair < SymbolType, SymbolType > > ( ).first == symbol ) ) if ( ( rhs.template is < SymbolType > ( ) && ( rhs.template get < SymbolType > ( ) == symbol ) ) || ( rhs.template get < ext::pair < SymbolType, SymbolType > > ( ).second == symbol ) )
return true; return true;
   
return false; return false;
...@@ -572,7 +572,7 @@ public: ...@@ -572,7 +572,7 @@ public:
return true; return true;
   
for ( const ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > & rhs : rule.second ) for ( const ext::variant < SymbolType, ext::pair < SymbolType, SymbolType > > & rhs : rule.second )
if ( rhs.template get < ext::pair < SymbolType, SymbolType > > ( ).second == symbol ) if ( rhs.template get < ext::pair < SymbolType, SymbolType > > ( ).first == symbol )
return true; return true;
   
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment