Esempio n. 1
0
void CIfAst::Execute(CInterpreterContext &context) const
{
    CValue result = m_condition->Evaluate(context);
    if (bool(result))
    {
        ExecuteAll(m_thenBody, context);
    }
    else
    {
        ExecuteAll(m_elseBody, context);
    }
}
Esempio n. 2
0
void CWhileAst::Execute(CInterpreterContext &context) const
{
    while (bool(m_condition->Evaluate(context)))
    {
        ExecuteAll(m_body, context);
    }
}
Esempio n. 3
0
void CRepeatAst::Execute(CInterpreterContext &context) const
{
    do
    {
        ExecuteAll(m_body, context);
    }
    while (bool(m_condition->Evaluate(context)));
}
Esempio n. 4
0
int main() {
    // Executing all tests will run all test cases and check leftover
    // stack size afterwards. It is expected that the stack size
    // post-test is 0.
    return ExecuteAll();

    // For debugging anything in particular, you can run an individual
    //test like so:
    //ExecuteTest("test_function_in_constructor");
}
Esempio n. 5
0
int main() {
	// Executing all tests will run all test cases and check leftover
	// stack size afterwards. It is expected that the stack size
	// post-test is 0.
	bool e = ExecuteAll();

	// For debugging anything in particular, you can run an individual
	//test like so:
	//ExecuteTest("test_function_should_run_once");

	getchar();

	return e;
}