mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-22 17:12:55 +08:00
ee90f9a60f
update cmsis-pack to v1.10 update v1.10.0 to cmsis-pack update makepdsc
25 lines
598 B
C
25 lines
598 B
C
#include "PikaObj.h"
|
|
|
|
Arg* PikaStdLib_RangeObj___next__(PikaObj* self) {
|
|
int a1 = args_getInt(self->list, "a1");
|
|
int a2 = args_getInt(self->list, "a2");
|
|
int start = 0;
|
|
int end = 0;
|
|
int foot = 1;
|
|
/* only start and end */
|
|
start = a1;
|
|
end = a2;
|
|
/* start */
|
|
int iter_i = args_getInt(self->list, "iter_i");
|
|
/* iter_i is not inited */
|
|
if (-999999999 == iter_i) {
|
|
iter_i = start;
|
|
}
|
|
/* exit */
|
|
if (iter_i >= end) {
|
|
return arg_newNull();
|
|
}
|
|
args_setInt(self->list, "iter_i", iter_i + foot);
|
|
return arg_newInt(iter_i);
|
|
}
|