mirror of
https://github.com/louisrubet/rpn
synced 2024-12-28 09:58:52 +01:00
#34: go on debugging start-next commands
This commit is contained in:
parent
075aa90fdd
commit
90d67f00cf
2 changed files with 11 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue