diff --git a/src/plugins/kumircodegenerator/generator.cpp b/src/plugins/kumircodegenerator/generator.cpp index 4cbe333bd59bd964b92876ab61a90284f79697c8..cf9f686d4f28ed39bf40b052e4c4316ec84bc9e8 100644 --- a/src/plugins/kumircodegenerator/generator.cpp +++ b/src/plugins/kumircodegenerator/generator.cpp @@ -774,6 +774,25 @@ void Generator::addFunction(int id, int moduleId, Bytecode::ElemType type, const ret << line; } + + if (alg->impl.endLexems.size()>0) { + QString endError; + for (int i=0; iimpl.endLexems.size();i++) { + if (alg->impl.endLexems[i]->error.size()>0) { + endError = ErrorMessages::message("KumirAnalizer", QLocale::Russian, alg->impl.endLexems[i]->error); + break; + } + } + if (endError.length()>0) { + Bytecode::Instruction err; + err.type = Bytecode::ERRORR; + err.scope = Bytecode::CONSTT; + err.arg = constantValue(Bytecode::VT_string, 0, endError); + ret << err; + } + } + + const AST::Variable * retval = returnValue(alg); if (retval) { Bytecode::Instruction loadRetval;