mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
Fix typos
This commit is contained in:
parent
8c8c5f13cf
commit
50e5f521c2
@ -288,4 +288,4 @@ Need further discussion.
|
|||||||
|
|
||||||
- in-place operators, such as `+=`, `-=`, `*=`, etc., are not supported in pocketpy.
|
- in-place operators, such as `+=`, `-=`, `*=`, etc., are not supported in pocketpy.
|
||||||
|
|
||||||
- thre return value of `globals` is immutable in pocketpy.
|
- the return value of `globals` is immutable in pocketpy.
|
@ -197,7 +197,7 @@ PK_API py_Name py_newfunction(py_OutRef out,
|
|||||||
/// Create a `boundmethod` object.
|
/// Create a `boundmethod` object.
|
||||||
PK_API void py_newboundmethod(py_OutRef out, py_Ref self, py_Ref func);
|
PK_API void py_newboundmethod(py_OutRef out, py_Ref self, py_Ref func);
|
||||||
|
|
||||||
/************* Name Convertions *************/
|
/************* Name Conversions *************/
|
||||||
|
|
||||||
/// Convert a null-terminated string to a name.
|
/// Convert a null-terminated string to a name.
|
||||||
PK_API py_Name py_name(const char*);
|
PK_API py_Name py_name(const char*);
|
||||||
@ -506,7 +506,7 @@ PK_API int py_import(const char* path) PY_RAISE PY_RETURN;
|
|||||||
|
|
||||||
/// Raise an exception by type and message. Always return false.
|
/// Raise an exception by type and message. Always return false.
|
||||||
PK_API bool py_exception(py_Type type, const char* fmt, ...) PY_RAISE;
|
PK_API bool py_exception(py_Type type, const char* fmt, ...) PY_RAISE;
|
||||||
/// Raise an expection object. Always return false.
|
/// Raise an exception object. Always return false.
|
||||||
PK_API bool py_raise(py_Ref) PY_RAISE;
|
PK_API bool py_raise(py_Ref) PY_RAISE;
|
||||||
/// Print the current exception.
|
/// Print the current exception.
|
||||||
/// The exception will be set as handled.
|
/// The exception will be set as handled.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#define equal(a, b) ((a) == (b))
|
#define equal(a, b) ((a) == (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Temprary macros */
|
/* Temporary macros */
|
||||||
#define partial_less(a, b) less((a).key, (b))
|
#define partial_less(a, b) less((a).key, (b))
|
||||||
#define CONCAT(A, B) CONCAT_(A, B)
|
#define CONCAT(A, B) CONCAT_(A, B)
|
||||||
#define CONCAT_(A, B) A##B
|
#define CONCAT_(A, B) A##B
|
||||||
|
@ -1343,14 +1343,14 @@ static bool stack_format_object(VM* self, c11_sv spec) {
|
|||||||
} else {
|
} else {
|
||||||
// {10.2f}
|
// {10.2f}
|
||||||
IntParsingResult res = c11__parse_uint(c11_sv__slice2(spec, 0, dot), &width, 10);
|
IntParsingResult res = c11__parse_uint(c11_sv__slice2(spec, 0, dot), &width, 10);
|
||||||
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifer");
|
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifier");
|
||||||
}
|
}
|
||||||
IntParsingResult res = c11__parse_uint(c11_sv__slice(spec, dot + 1), &precision, 10);
|
IntParsingResult res = c11__parse_uint(c11_sv__slice(spec, dot + 1), &precision, 10);
|
||||||
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifer");
|
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifier");
|
||||||
} else {
|
} else {
|
||||||
// {10s}
|
// {10s}
|
||||||
IntParsingResult res = c11__parse_uint(spec, &width, 10);
|
IntParsingResult res = c11__parse_uint(spec, &width, 10);
|
||||||
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifer");
|
if(res != IntParsing_SUCCESS) return ValueError("invalid format specifier");
|
||||||
precision = -1;
|
precision = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ void VM__ctor(VM* self) {
|
|||||||
|
|
||||||
self->builtins = pk_builtins__register();
|
self->builtins = pk_builtins__register();
|
||||||
|
|
||||||
// inject some builtin expections
|
// inject some builtin exceptions
|
||||||
#define INJECT_BUILTIN_EXC(name, TBase) \
|
#define INJECT_BUILTIN_EXC(name, TBase) \
|
||||||
do { \
|
do { \
|
||||||
py_Type type = pk_newtype(#name, TBase, &self->builtins, NULL, false, true); \
|
py_Type type = pk_newtype(#name, TBase, &self->builtins, NULL, false, true); \
|
||||||
|
@ -703,7 +703,7 @@ bool py_pickle_loads_body(const unsigned char* p, int memo_length, c11_smallmap_
|
|||||||
static bool PickleObject__py_submit(PickleObject* self, py_OutRef out) {
|
static bool PickleObject__py_submit(PickleObject* self, py_OutRef out) {
|
||||||
c11_sbuf cleartext;
|
c11_sbuf cleartext;
|
||||||
c11_sbuf__ctor(&cleartext);
|
c11_sbuf__ctor(&cleartext);
|
||||||
// line 1: type mappping
|
// line 1: type mapping
|
||||||
for(py_Type type = 0; type < self->used_types_length; type++) {
|
for(py_Type type = 0; type < self->used_types_length; type++) {
|
||||||
if(self->used_types[type]) {
|
if(self->used_types[type]) {
|
||||||
c11_sbuf__write_int(&cleartext, type);
|
c11_sbuf__write_int(&cleartext, type);
|
||||||
|
@ -153,7 +153,7 @@ void py_clearexc(py_StackRef p0) {
|
|||||||
VM* vm = pk_current_vm;
|
VM* vm = pk_current_vm;
|
||||||
vm->curr_exception = *py_NIL();
|
vm->curr_exception = *py_NIL();
|
||||||
vm->is_curr_exc_handled = false;
|
vm->is_curr_exc_handled = false;
|
||||||
/* Don't clear this, because StopIteration() may corrupt the class defination */
|
/* Don't clear this, because StopIteration() may corrupt the class definition */
|
||||||
// vm->__curr_class = NULL;
|
// vm->__curr_class = NULL;
|
||||||
vm->__curr_function = NULL;
|
vm->__curr_function = NULL;
|
||||||
if(p0) vm->stack.sp = p0;
|
if(p0) vm->stack.sp = p0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user