1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-17 00:44:19 +00:00

BLOCKS API: Added a couple of missing simplification steps in the littlefoot compiler

This commit is contained in:
jules 2017-07-07 14:51:25 +01:00
parent fb172ac41b
commit 355addb5c3

View file

@ -1516,6 +1516,15 @@ private:
cg.continueTarget = oldContinueTarget;
}
StatementPtr simplify (SyntaxTreeBuilder& stb) override
{
initialiser = initialiser->simplify (stb);
iterator = iterator->simplify (stb);
body = body->simplify (stb);
condition = condition->simplify (stb);
return this;
}
void visitSubStatements (Statement::Visitor& visit) const override
{
visit (condition); visit (initialiser); visit (iterator); visit (body);
@ -1548,6 +1557,12 @@ private:
bool alwaysReturns() const override { return true; }
StatementPtr simplify (SyntaxTreeBuilder& stb) override
{
returnValue = returnValue->simplify (stb);
return this;
}
void visitSubStatements (Statement::Visitor& visit) const override
{
visit (returnValue);