This commit is contained in:
s-hadinger 2023-07-16 15:05:41 +02:00 committed by GitHub
parent f4ff0010af
commit 00249ac3eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ static int m_init(bvm *vm)
{
int argc = be_top(vm);
if (argc < 3) { be_raise(vm, "value_error", "missing arguments"); }
if (!be_isint(vm, 2) || !be_isint(vm, 3)) { be_raise(vm, "value_error", "argmunets must be 'int'"); }
if (!be_isint(vm, 2) || !be_isint(vm, 3)) { be_raise(vm, "value_error", "arguments must be 'int'"); }
be_pushvalue(vm, 2);
be_setmember(vm, 1, "__lower__");
be_pop(vm, 1);
@ -21,7 +21,7 @@ static int m_init(bvm *vm)
be_setmember(vm, 1, "__upper__");
int incr = 1; /* default increment is '1' */
if (argc >= 4) {
if (!be_isint(vm, 4)) { be_raise(vm, "value_error", "argmunets must be 'int'"); }
if (!be_isint(vm, 4)) { be_raise(vm, "value_error", "arguments must be 'int'"); }
incr = be_toint(vm, 4);
if (incr == 0) { be_raise(vm, "value_error", "increment cannot be zero"); }
}
@ -100,7 +100,7 @@ static int m_setrange(bvm *vm)
{
int argc = be_top(vm);
if (argc < 3) { be_raise(vm, "value_error", "missing arguments"); }
if (!be_isint(vm, 2) || !be_isint(vm, 3)) { be_raise(vm, "value_error", "argmunets must be 'int'"); }
if (!be_isint(vm, 2) || !be_isint(vm, 3)) { be_raise(vm, "value_error", "arguments must be 'int'"); }
be_pushvalue(vm, 2);
be_setmember(vm, 1, "__lower__");
be_pop(vm, 1);
@ -108,7 +108,7 @@ static int m_setrange(bvm *vm)
be_setmember(vm, 1, "__upper__");
int incr = 1; /* default increment is '1' */
if (argc >= 4) {
if (!be_isint(vm, 4)) { be_raise(vm, "value_error", "argmunets must be 'int'"); }
if (!be_isint(vm, 4)) { be_raise(vm, "value_error", "arguments must be 'int'"); }
incr = be_toint(vm, 4);
if (incr == 0) { be_raise(vm, "value_error", "increment cannot be zero"); }
}