X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogramcompiler.cpp;h=c2ebb4b96ad3e474b2f636578e404601282b82ad;hp=1a3cd34fae5067201f81dabf8ffcdf76121b0d59;hb=437cd7d38fea1533aab9414d4575acb63d6b9170;hpb=d366b051df5543c46ebae383ce08e940788e950d diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 1a3cd34f..c2ebb4b9 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -557,8 +557,12 @@ void ProgramCompiler::Formatter::visit(Iteration &iter) void ProgramCompiler::Formatter::visit(Return &ret) { - formatted += "return "; - ret.expression->visit(*this); + formatted += "return"; + if(ret.expression) + { + formatted += ' '; + ret.expression->visit(*this); + } formatted += ';'; }