#34: go on debugging start-next commands

This commit is contained in:
Louis Rubet 2017-05-15 18:00:31 +02:00
parent 075aa90fdd
commit 90d67f00cf
2 changed files with 11 additions and 1 deletions

View file

@ -49,6 +49,8 @@ void rpn_end(void)
int rpn_start(branch& myobj)
{
int ret = -1;
MIN_ARGUMENTS_RET(2, 1);
ARG_MUST_BE_OF_TYPE_RET(0, cmd_number, -1);
ARG_MUST_BE_OF_TYPE_RET(1, cmd_number, -1);
@ -63,7 +65,14 @@ int rpn_start(branch& myobj)
myobj.farg1 = (number*)_branch_stack.back();
_stack->pop_back();
return -1;
// test value
if (myobj.farg1->_value > myobj.farg2->_value)
// last boundary lower than first boundary
// -> next command shall be after 'next'
// arg2 holds index of 'next'
ret = myobj.arg2 + 1;
return ret;
}
int rpn_for(branch& myobj)

View file

@ -661,6 +661,7 @@ public:
return ret_syntax;
}
k->arg1 = vstartindex[vstartindex.size() - 1];// fill 'next' branch1 = 'start' index
((branch*)seq_obj(vstartindex[vstartindex.size() - 1]))->arg2 = i;// fill 'for' or 'start' arg2 = 'next' index
vstartindex.pop_back();
}
else if (compare_branch(k, "step", 4))