mirror of
https://github.com/pocketpy/pocketpy
synced 2025-11-09 21:20:17 +00:00
Fix Typos
This commit is contained in:
parent
e7f278188f
commit
5abbcfa1c1
@ -2,7 +2,7 @@ MIT License
|
||||
|
||||
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Sofware without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"backupLimit": 10,
|
||||
"backupRelPath": null,
|
||||
"levelNamePattern": "%world_Level_%idx",
|
||||
"tutorialDesc": "In \"Free\" world layout, levels are positionned freely in the 2D space.\n\nIn this example, some are even in different world layers (ie. above and behind). Use [PAGE UP] and [PAGE DOWN] to move between world layers.",
|
||||
"tutorialDesc": "In \"Free\" world layout, levels are positioned freely in the 2D space.\n\nIn this example, some are even in different world layers (ie. above and behind). Use [PAGE UP] and [PAGE DOWN] to move between world layers.",
|
||||
"customCommands": [],
|
||||
"flags": ["UseMultilinesType"],
|
||||
"defs": { "layers": [
|
||||
|
||||
@ -364,7 +364,7 @@ int main(int argc, char** argv) {
|
||||
PRINT_TITLE("test other errors");
|
||||
check(pkpy_getglobal(vm, pkpy_name("test_error_propagate")));
|
||||
check(pkpy_pop_top(vm));
|
||||
fail(pkpy_getglobal(vm, pkpy_name("nonexistant")));
|
||||
fail(pkpy_getglobal(vm, pkpy_name("nonexistent")));
|
||||
error(pkpy_exec(vm, "raise NameError('testing error throwing from python')"));
|
||||
|
||||
PRINT_TITLE("test TypeError");
|
||||
|
||||
@ -13,7 +13,7 @@ For methods, `call_method` can be used.
|
||||
+ `PyObject* call(PyObject* obj, ...)`
|
||||
+ `PyObject* call_method(PyObject* obj, StrName name, ...)`
|
||||
|
||||
### Exmaple
|
||||
### Example
|
||||
|
||||
Let's create a `dict` object and set a key-value pair,
|
||||
which equals to the following python snippet.
|
||||
|
||||
@ -143,7 +143,7 @@ The constructor can take 1 extra parameters.
|
||||
|
||||
#### `VM(bool enable_os=true)`
|
||||
|
||||
+ `enable_os`, whether to enable OS-related features or not. This setting controls the availability of priviledged modules such os `io` and `os` as well as builtin function `open`. **It is designed for sandboxing.**
|
||||
+ `enable_os`, whether to enable OS-related features or not. This setting controls the availability of privileged modules such os `io` and `os` as well as builtin function `open`. **It is designed for sandboxing.**
|
||||
|
||||
When you are done with the `VM` instance, use `delete` operator to dispose it.
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ PocketPython provides a sandboxed Python environment.
|
||||
All python code is executed in a C# virtual machine.
|
||||
The user cannot access the file system, network, or any other resources of the host machine.
|
||||
|
||||
### Seemless Interop with C#
|
||||
### Seamless Interop with C#
|
||||
|
||||
PocketPython uses `object` in C# to represent dynamic typed Python objects.
|
||||
Most of the basic Python types correspond to a C# type,
|
||||
|
||||
@ -9,18 +9,18 @@
|
||||
/*************** feature settings ***************/
|
||||
|
||||
// Whether to compile os-related modules or not
|
||||
#ifndef PK_ENABLE_OS // can be overrided by cmake
|
||||
#ifndef PK_ENABLE_OS // can be overridden by cmake
|
||||
#define PK_ENABLE_OS 0
|
||||
#endif
|
||||
|
||||
// Enable this if you are working with multi-threading (experimental)
|
||||
// This triggers necessary locks to make the VM thread-safe
|
||||
#ifndef PK_ENABLE_THREAD // can be overrided by cmake
|
||||
#ifndef PK_ENABLE_THREAD // can be overridden by cmake
|
||||
#define PK_ENABLE_THREAD 0
|
||||
#endif
|
||||
|
||||
// GC min threshold
|
||||
#ifndef PK_GC_MIN_THRESHOLD // can be overrided by cmake
|
||||
#ifndef PK_GC_MIN_THRESHOLD // can be overridden by cmake
|
||||
#define PK_GC_MIN_THRESHOLD 32768
|
||||
#endif
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@ namespace pkpy
|
||||
newDeque.insertObj(false, true, -1, *it);
|
||||
return newDequeObj;
|
||||
});
|
||||
// NEW: counts the number of occurences of the given object in the deque
|
||||
// NEW: counts the number of occurrences of the given object in the deque
|
||||
vm->bind(type, "count(self, obj) -> int",
|
||||
[](VM *vm, ArgsView args)
|
||||
{
|
||||
@ -290,7 +290,7 @@ namespace pkpy
|
||||
self.insertObj(false, false, index, obj); // this index shouldn't be fixed using vm->normalized_index, pass as is
|
||||
return vm->None;
|
||||
});
|
||||
// NEW: removes the first occurence of the given object from the deque
|
||||
// NEW: removes the first occurrence of the given object from the deque
|
||||
vm->bind(type, "remove(self, obj) -> None",
|
||||
[](VM *vm, ArgsView args)
|
||||
{
|
||||
@ -450,7 +450,7 @@ namespace pkpy
|
||||
/// @brief pops or removes an item from the deque
|
||||
/// @param front if true, pop from the front of the deque
|
||||
/// @param back if true, pop from the back of the deque
|
||||
/// @param item if front and back is not set, remove the first occurence of item from the deque
|
||||
/// @param item if front and back is not set, remove the first occurrence of item from the deque
|
||||
/// @param vm is needed for the py_eq
|
||||
/// @return PyObject* if front or back is set, this is a pop operation and we return a PyObject*, if front and back are not set, this is a remove operation and we return the removed item or nullptr
|
||||
PyObject *PyDeque::popObj(bool front, bool back, PyObject *item, VM *vm)
|
||||
|
||||
@ -591,7 +591,7 @@ namespace pkpy{
|
||||
ctx->emit_(OP_CALL_TP, 0, line);
|
||||
}
|
||||
}else{
|
||||
// vectorcall protocal
|
||||
// vectorcall protocol
|
||||
for(auto& item: args) item->emit_(ctx);
|
||||
for(auto& item: kwargs){
|
||||
uint16_t index = StrName(item.first.sv()).index;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user