From 5abbcfa1c1057fe840bc9664ed96bcfac0b972f8 Mon Sep 17 00:00:00 2001 From: faze-geek Date: Wed, 21 Feb 2024 12:20:11 +0530 Subject: [PATCH] Fix Typos --- 3rd/cjson/LICENSE | 2 +- benchmarks/res/WorldMap_Free_layout.ldtk | 2 +- c_bindings/test.c | 2 +- docs/quick-start/call.md | 2 +- docs/quick-start/installation.md | 2 +- docs/unity/introduction.md | 2 +- include/pocketpy/config.h | 6 +++--- src/collections.cpp | 6 +++--- src/expr.cpp | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/3rd/cjson/LICENSE b/3rd/cjson/LICENSE index 8b84267d..d3a4c979 100644 --- a/3rd/cjson/LICENSE +++ b/3rd/cjson/LICENSE @@ -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. diff --git a/benchmarks/res/WorldMap_Free_layout.ldtk b/benchmarks/res/WorldMap_Free_layout.ldtk index 602ae980..8321e674 100644 --- a/benchmarks/res/WorldMap_Free_layout.ldtk +++ b/benchmarks/res/WorldMap_Free_layout.ldtk @@ -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": [ diff --git a/c_bindings/test.c b/c_bindings/test.c index 1800d871..10bdd885 100644 --- a/c_bindings/test.c +++ b/c_bindings/test.c @@ -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"); diff --git a/docs/quick-start/call.md b/docs/quick-start/call.md index bbfc2a23..4899a5d6 100644 --- a/docs/quick-start/call.md +++ b/docs/quick-start/call.md @@ -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. diff --git a/docs/quick-start/installation.md b/docs/quick-start/installation.md index ed9d20df..b7d7ccff 100644 --- a/docs/quick-start/installation.md +++ b/docs/quick-start/installation.md @@ -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. diff --git a/docs/unity/introduction.md b/docs/unity/introduction.md index 8832dd9f..b76117f6 100644 --- a/docs/unity/introduction.md +++ b/docs/unity/introduction.md @@ -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, diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index 21eb80f2..284e68bf 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -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 diff --git a/src/collections.cpp b/src/collections.cpp index 65a17f1a..79e6cece 100644 --- a/src/collections.cpp +++ b/src/collections.cpp @@ -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) diff --git a/src/expr.cpp b/src/expr.cpp index 8c9ed9cb..791e3a8c 100644 --- a/src/expr.cpp +++ b/src/expr.cpp @@ -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;