diff --git a/alib2aux/src/convert/LatexConverter.h b/alib2aux/src/convert/LatexConverter.h index 5e8e4e2393c5b6dd027021ab6ef0f58274ef3406..ff389b06f84d7a7910a02a3ce19cdc22a5dd9059 100644 --- a/alib2aux/src/convert/LatexConverter.h +++ b/alib2aux/src/convert/LatexConverter.h @@ -17,6 +17,7 @@ #include "common/converterCommon.hpp" #include <factory/StringDataFactory.hpp> +#include <container/string/ObjectsVariant.h> namespace convert { @@ -228,12 +229,9 @@ void LatexConverter::rules ( ext::ostream & out, const grammar::CFG < TerminalSy if ( itRhs != kv.second.begin ( ) ) out << " \\mid "; - for ( const auto & symb : *itRhs ) { - if ( symb.template is < TerminalSymbolType > ( ) ) - out << replace ( factory::StringDataFactory::toString ( symb.template get < TerminalSymbolType > ( ) ), "\"", "\\\"" ) << " "; - else if ( symb.template is < NonterminalSymbolType > ( ) ) - out << replace ( factory::StringDataFactory::toString ( symb.template get < NonterminalSymbolType > ( ) ), "\"", "\\\"" ) << " "; - } + for ( const auto & symb : *itRhs ) + out << replace ( factory::StringDataFactory::toString ( symb ), "\"", "\\\"" ) << " "; + if ( itRhs -> empty ( ) ) out << "\\varepsilon"; }