1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

fixed while loop implementation

This commit is contained in:
Marc Zinnschlag 2014-02-11 13:31:04 +01:00
parent 5c0071f320
commit f26aa4f645

View file

@ -9,6 +9,7 @@
#include "generator.hpp"
#include "errorhandler.hpp"
#include <iostream>
namespace Compiler
{
bool ControlParser::parseIfBody (int keyword, const TokenLoc& loc, Scanner& scanner)
@ -107,7 +108,7 @@ namespace Compiler
Codes expr;
mExprParser.append (expr);
Generator::jump (loop, -static_cast<int> (mCodeBlock.size()-expr.size()));
Generator::jump (loop, -static_cast<int> (mCodeBlock.size()+expr.size()));
std::copy (expr.begin(), expr.end(), std::back_inserter (mCode));
@ -121,7 +122,7 @@ namespace Compiler
Codes loop2;
Generator::jump (loop2, -static_cast<int> (mCodeBlock.size()-expr.size()-skip.size()));
Generator::jump (loop2, -static_cast<int> (mCodeBlock.size()+expr.size()+skip.size()));
if (loop.size()!=loop2.size())
throw std::logic_error (