implemented swap
This commit is contained in:
parent
8e67857c95
commit
6a82cde8f2
|
|
@ -1182,8 +1182,17 @@ Boolean builtin_sqrt(InterpreterState *interpreter_state) {
|
|||
}
|
||||
|
||||
Boolean builtin_swap(InterpreterState *interpreter_state) {
|
||||
(void)interpreter_state;
|
||||
return FALSE;
|
||||
if (interpreter_state->stack == NULL) return FALSE;
|
||||
if (interpreter_state->stack->next == NULL) return FALSE;
|
||||
|
||||
StackItem *a = interpreter_state->stack;
|
||||
StackItem *b = a->next;
|
||||
|
||||
a->next = b->next;
|
||||
b->next = a;
|
||||
interpreter_state->stack = b;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Boolean builtin_tan(InterpreterState *interpreter_state) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue