mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
15 lines
326 B
C
15 lines
326 B
C
#include "PikaObj.h"
|
|
|
|
Arg* PikaStdLib_RangeObj___next__(PikaObj* self) {
|
|
RangeData* _ = (RangeData*)args_getStruct(self->list, "_");
|
|
int end = _->end;
|
|
int step = _->step;
|
|
/* exit */
|
|
if (_->i >= end) {
|
|
return arg_newNull();
|
|
}
|
|
Arg* res = arg_newInt(_->i);
|
|
_->i += step;
|
|
return res;
|
|
}
|