Fix spelling (#128)

* Fix spelling in .cpp files

* Fix spelling in all files
This commit is contained in:
Yaya-Cout
2022-01-20 17:21:35 +01:00
committed by GitHub
parent e575ffc7ce
commit 169fb7404e
215 changed files with 424 additions and 425 deletions

View File

@@ -201,7 +201,7 @@ $(call object_for,python/src/py/objmodule.c): SFLAGS += -DMP_QSTR_urandom="MP_QS
$(call object_for,python/src/extmod/modurandom.c): SFLAGS += -DMP_QSTR_urandom="MP_QSTR_random"
# Rename usys to sys
# In order to change the name of the micropython module 'usys' to 'usys'
# In order to change the name of the micropython module 'usys' to 'sys'
# (without altering micropython files), we redefined the macro MP_QSTR_usys
# by DMP_QSTR_sys.
$(call object_for,python/src/py/objmodule.c): SFLAGS += -DMP_QSTR_usys="MP_QSTR_sys"

View File

@@ -762,7 +762,7 @@ STATIC mp_obj_t file_writelines(mp_obj_t o_in, mp_obj_t o_lines) {
}
/*
* Simpler read function usef by read and readline.
* Simpler read function used by read and readline.
*/
STATIC mp_obj_t __file_read_backend(file_obj_t* file, mp_int_t size, bool with_line_sep) {
size_t file_size = file->record.value().size;

View File

@@ -4,7 +4,7 @@ extern "C" {
#include <ion.h>
/* We cannot use C99-style struct initizalition in C++. As a result, we cannot
/* We cannot use C99-style struct initialization in C++. As a result, we cannot
* use the macros that micropython recommends, and we have to hand build those
* structs. To avoid errors, we drop in a few static_asserts. */

View File

@@ -26,7 +26,7 @@ static size_t extractArgument(mp_obj_t arg, mp_obj_t ** items) {
return itemLength;
}
// Extract two scalar or array arguments and check for their strickly equal dimension
// Extract two scalar or array arguments and check for their strictly equal dimension
static size_t extractArgumentsAndCheckEqualSize(mp_obj_t x, mp_obj_t y, mp_obj_t ** xItems, mp_obj_t ** yItems) {
size_t xLength = extractArgument(x, xItems);

View File

@@ -21,7 +21,7 @@ mp_obj_t modtime_monotonic() {
}
//
// Omega extensions, based off MicroPython's modutime.c
// Upsilon extensions, based off MicroPython's modutime.c
//
// LEAPOCH corresponds to 2000-03-01, which is a mod-400 year, immediately

View File

@@ -4,14 +4,14 @@ mp_obj_t modtime_sleep(mp_obj_t seconds_o);
mp_obj_t modtime_monotonic();
//
// Omega extensions.
// Upsilon extensions.
//
mp_obj_t modtime_localtime(size_t n_args, const mp_obj_t *args);
mp_obj_t modtime_mktime(mp_obj_t tuple);
mp_obj_t modtime_time(void);
// Omega private extensions.
// Upsilon private extensions.
mp_obj_t modtime_rtcmode(void);
mp_obj_t modtime_setrtcmode(mp_obj_t mode);

View File

@@ -849,7 +849,7 @@ STATIC uint8_t ndarray_init_helper(size_t n_args, const mp_obj_t *pos_args, mp_m
if(mp_obj_is_type(args[1].u_obj, &ulab_dtype_type)) {
dtype_obj_t *dtype = MP_OBJ_TO_PTR(args[1].u_obj);
_dtype = dtype->dtype;
} else { // this must be an integer defined as a class constant (ulba.uint8 etc.)
} else { // this must be an integer defined as a class constant (ulab.uint8 etc.)
_dtype = mp_obj_get_int(args[1].u_obj);
}
#else

View File

@@ -55,7 +55,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fft_fft_obj, 1, 2, fft_fft);
//| :param ulab.numpy.ndarray c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value
//| :return tuple (r, c): The real and complex parts of the inverse FFT
//|
//| Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain"""
//| Perform an Inverse Fast Fourier Transform from the frequency domain into the time domain"""
//| ...
//|

View File

@@ -164,7 +164,7 @@ mp_obj_t poly_polyval(mp_obj_t o_p, mp_obj_t o_x) {
mp_float_t (*func)(void *) = ndarray_get_float_function(source->dtype);
// TODO: these loops are really nothing, but the re-impplementation of
// TODO: these loops are really nothing, but the re-implementation of
// ITERATE_VECTOR from vectorise.c. We could pass a function pointer here
#if ULAB_MAX_DIMS > 3
size_t i = 0;

View File

@@ -121,7 +121,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(optimize_bisect_obj, 3, optimize_bisect);
//| Find a minimum of the function ``f(x)`` using the downhill simplex method.
//| The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)``
//| is within ``fatol`` of the actual minimum unless more than ``maxiter``
//| steps are requried."""
//| steps are required."""
//| ...
//|
@@ -344,7 +344,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(optimize_curve_fit_obj, 2, optimize_curve_fit);
//|
//| Find a solution (zero) of the function ``f(x)`` using Newton's Method.
//| The result is accurate to within ``xtol * rtol * |f(x)|`` unless more than
//| ``maxiter`` steps are requried."""
//| ``maxiter`` steps are required."""
//| ...
//|

View File

@@ -74,7 +74,7 @@ static mp_obj_t user_square(mp_obj_t arg) {
*rarray++ = (*array) * (*array);
}
}
// at the end, return a micrppython object
// at the end, return a micropython object
return MP_OBJ_FROM_PTR(results);
}

View File

@@ -212,7 +212,7 @@ void MicroPython::collectRootsAtAddress(char * address, int byteLength) {
uintptr_t alignedAddress = reinterpret_cast<uintptr_t>(address) & bitMaskZeros;
/* Increase the length consequently with the new alignment
* (We don't need to increase the byteLength to a sizeof(uintptr_t)-aligned
* lenght because no pointer can be stored on less than sizeof(uintptr_t)
* length because no pointer can be stored on less than sizeof(uintptr_t)
* bytes.) */
int alignedByteLength = byteLength;
alignedByteLength += reinterpret_cast<uintptr_t>(address) & bitMaskOnes;

View File

@@ -705,7 +705,7 @@ STATIC void compile_funcdef_lambdef_param(compiler_t *comp, mp_parse_node_t pn)
} else {
// this parameter has a default value
// in CPython, None (and True, False?) as default parameters are loaded with LOAD_NAME; don't understandy why
// in CPython, None (and True, False?) as default parameters are loaded with LOAD_NAME; don't understand why
if (comp->have_star) {
comp->num_dict_params += 1;

View File

@@ -574,7 +574,7 @@ STATIC void emit_native_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scop
if (emit->pass == MP_PASS_CODE_SIZE) {
// Commit to the encoding size based on the value of prelude_offset in this pass.
// By using 32768 as the cut-off it is highly unlikely that prelude_offset will
// grow beyond 65535 by the end of thiss pass, and so require the larger encoding.
// grow beyond 65535 by the end of this pass, and so require the larger encoding.
emit->prelude_offset_uses_u16_encoding = emit->prelude_offset < 32768;
}
if (emit->prelude_offset_uses_u16_encoding) {
@@ -874,7 +874,7 @@ STATIC vtype_kind_t load_reg_stack_imm(emit_t *emit, int reg_dest, const stack_i
}
}
// Copies all unsettled registers and immediates that are Python values into the
// Copies all unsettled registers and immediate that are Python values into the
// concrete Python stack. This ensures the concrete Python stack holds valid
// values for the current stack_size.
// This function may clobber REG_TEMP1.
@@ -1070,7 +1070,7 @@ STATIC void emit_get_stack_pointer_to_reg_for_pop(emit_t *emit, mp_uint_t reg_de
}
}
// Adujust the stack for a pop of n_pop items, and load the stack pointer into reg_dest.
// Adjust the stack for a pop of n_pop items, and load the stack pointer into reg_dest.
adjust_stack(emit, -n_pop);
emit_native_mov_reg_state_addr(emit, reg_dest, emit->stack_start + emit->stack_size);
}

View File

@@ -318,7 +318,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch
// We now have num.f as a floating point number between >= 1 and < 10
// (or equal to zero), and e contains the absolute value of the power of
// 10 exponent. and (dec + 1) == the number of dgits before the decimal.
// 10 exponent. and (dec + 1) == the number of digits before the decimal.
// For e, prec is # digits after the decimal
// For f, prec is # digits after the decimal

View File

@@ -512,7 +512,7 @@ found:
// Set last free ATB index to block after last block we found, for start of
// next scan. To reduce fragmentation, we only do this if we were looking
// for a single free block, which guarantees that there are no free blocks
// before this one. Also, whenever we free or shink a block we must check
// before this one. Also, whenever we free or shrink a block we must check
// if this index needs adjusting (see gc_realloc and gc_free).
if (n_free == 1) {
MP_STATE_MEM(gc_last_free_atb_index) = (i + 1) / BLOCKS_PER_ATB;

View File

@@ -594,7 +594,7 @@ void mp_lexer_to_next(mp_lexer_t *lex) {
// a string or bytes literal
// Python requires adjacent string/bytes literals to be automatically
// concatenated. We do it here in the tokeniser to make efficient use of RAM,
// concatenated. We do it here in the tokenizer to make efficient use of RAM,
// because then the lexer's vstr can be used to accumulate the string literal,
// in contrast to creating a parse tree of strings and then joining them later
// in the compiler. It's also more compact in code size to do it here.

View File

@@ -32,7 +32,7 @@
#include "py/qstr.h"
#include "py/reader.h"
/* lexer.h -- simple tokeniser for MicroPython
/* lexer.h -- simple tokenizer for MicroPython
*
* Uses (byte) length instead of null termination.
* Tokens are the same - UTF-8 with (byte) length.

View File

@@ -24,7 +24,7 @@ def check_non_ascii(msg):
# Replace <char><space> with <char | 0x80>.
# Trival scheme to demo/test.
# Trivial scheme to demo/test.
def space_compression(error_strings):
for line in error_strings:
check_non_ascii(line)

View File

@@ -16,7 +16,7 @@ endif
# QSTR generation uses the same CFLAGS, with these modifications.
QSTR_GEN_FLAGS = -DNO_QSTR
# Note: := to force evalulation immediately.
# Note: := to force evaluation immediately.
QSTR_GEN_CFLAGS := $(CFLAGS)
QSTR_GEN_CFLAGS += $(QSTR_GEN_FLAGS)
QSTR_GEN_CXXFLAGS := $(CXXFLAGS)
@@ -28,7 +28,7 @@ QSTR_GEN_CXXFLAGS += $(QSTR_GEN_FLAGS)
# tree.
#
# So for example, py/map.c would have an object file name py/map.o
# The object files will go into the build directory and mantain the same
# The object files will go into the build directory and maintain the same
# directory structure as the source tree. So the final dependency will look
# like this:
#
@@ -184,7 +184,7 @@ endif
ifneq ($(PROG),)
# Build a standalone executable (unix does this)
# The executable should have an .exe extension for builds targetting 'pure'
# The executable should have an .exe extension for builds targeting 'pure'
# Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc.
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))

View File

@@ -79,7 +79,7 @@ STATIC mp_obj_t mp_builtin___build_class__(size_t n_args, const mp_obj_t *args)
meta_args[2] = class_locals; // dict of members
mp_obj_t new_class = mp_call_function_n_kw(meta, 3, 0, meta_args);
// store into cell if neede
// store into cell if needed
if (cell != mp_const_none) {
mp_obj_cell_set(cell, new_class);
}

View File

@@ -1221,7 +1221,7 @@ typedef double mp_float_t;
// the semantics of CPython's pkg_resources.resource_stream()
// (allows to access binary resources in frozen source packages).
// Note that the same functionality can be achieved in "pure
// Python" by prepocessing binary resources into Python source
// Python" by preprocessing binary resources into Python source
// and bytecode-freezing it (with a simple helper module available
// e.g. in micropython-lib).
#ifndef MICROPY_PY_IO_RESOURCE_STREAM

View File

@@ -279,7 +279,7 @@ mp_obj_t mp_obj_equal_not_equal(mp_binary_op_t op, mp_obj_t o1, mp_obj_t o2) {
o2 = temp;
}
// equality not implemented, so fall back to pointer conparison
// equality not implemented, so fall back to pointer comparison
return (o1 == o2) ? local_true : local_false;
}

View File

@@ -98,7 +98,7 @@ mp_obj_t mp_parse_num_integer(const char *restrict str_, size_t len, int base, m
break;
}
// add next digi and check for overflow
// add next digit and check for overflow
if (mp_small_int_mul_overflow(int_val, base)) {
goto overflow;
}

View File

@@ -2,7 +2,7 @@
#include "execution_environment.h"
QUIZ_CASE(python_basics) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "2+3","5\n");
deinit_environment();
}

View File

@@ -51,7 +51,7 @@ bool execute_input(TestExecutionEnvironment env, bool singleCommandLine, const c
return executionResult;
}
TestExecutionEnvironment init_environement() {
TestExecutionEnvironment init_environnement() {
MicroPython::init(TestExecutionEnvironment::s_pythonHeap, TestExecutionEnvironment::s_pythonHeap + TestExecutionEnvironment::s_pythonHeapSize);
return TestExecutionEnvironment();
}
@@ -61,7 +61,7 @@ void deinit_environment() {
}
void assert_script_execution_result(bool expectedResult, const char * script, const char * outputText = nullptr) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
quiz_assert(expectedResult == execute_input(env, false, script, outputText));
deinit_environment();
}

View File

@@ -15,7 +15,7 @@ private:
size_t m_printTextIndex;
};
TestExecutionEnvironment init_environement();
TestExecutionEnvironment init_environnement();
void deinit_environment();
void assert_script_execution_succeeds(const char * script, const char * outputText = nullptr);

View File

@@ -3,14 +3,14 @@
QUIZ_CASE(python_ion_import) {
// Test "from ion import *"
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "keydown(KEY_LEFT)");
assert_command_execution_succeeds(env, "from ion import *");
assert_command_execution_succeeds(env, "keydown(KEY_LEFT)");
deinit_environment();
// "import ion"
env = init_environement();
env = init_environnement();
assert_command_execution_fails(env, "ion.keydown(ion.KEY_LEFT)");
assert_command_execution_succeeds(env, "import ion");
assert_command_execution_succeeds(env, "ion.keydown(ion.KEY_LEFT)");
@@ -18,7 +18,7 @@ QUIZ_CASE(python_ion_import) {
}
QUIZ_CASE(python_ion_keydown) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from ion import *");
assert_command_execution_succeeds(env, "keydown(KEY_LEFT)", "False\n");
deinit_environment();

View File

@@ -3,14 +3,14 @@
QUIZ_CASE(python_kandinsky_import) {
// Test "from kandinsky import *"
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "get_pixel(0,0)");
assert_command_execution_succeeds(env, "from kandinsky import *");
assert_command_execution_succeeds(env, "get_pixel(0,0)");
deinit_environment();
// "import kandinsky"
env = init_environement();
env = init_environnement();
assert_command_execution_fails(env, "kandinsky.get_pixel(0,0)");
assert_command_execution_succeeds(env, "import kandinsky");
assert_command_execution_succeeds(env, "kandinsky.get_pixel(0,0)");
@@ -18,7 +18,7 @@ QUIZ_CASE(python_kandinsky_import) {
}
QUIZ_CASE(python_kandinsky_basics) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from kandinsky import *");
assert_command_execution_succeeds(env, "set_pixel(0,0,color(12,12,12))");
assert_command_execution_succeeds(env, "get_pixel(0,0)");

View File

@@ -2,7 +2,7 @@
#include "execution_environment.h"
QUIZ_CASE(python_math) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from math import *");
assert_command_execution_succeeds(env, "e", "2.718281828459045\n");
assert_command_execution_succeeds(env, "gamma(3)", "2.0\n");
@@ -10,7 +10,7 @@ QUIZ_CASE(python_math) {
}
QUIZ_CASE(python_cmath) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from cmath import *");
assert_command_execution_succeeds(env, "cos(0)", "(1+-0j)\n");
deinit_environment();

View File

@@ -3,28 +3,28 @@
QUIZ_CASE(python_matplotlib_pyplot_import) {
// Test "from matplotlib.pyplot import *"
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "arrow(2,3,4,5)");
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "arrow(2,3,4,5)");
deinit_environment();
// "from matplotlib import *"
env = init_environement();
env = init_environnement();
assert_command_execution_fails(env, "pyplot.arrow(2,3,4,5)");
assert_command_execution_succeeds(env, "from matplotlib import *");
assert_command_execution_succeeds(env, "pyplot.arrow(2,3,4,5)");
deinit_environment();
// "import matplotlib"
env = init_environement();
env = init_environnement();
assert_command_execution_fails(env, "matplotlib.pyplot.arrow(2,3,4,5)");
assert_command_execution_succeeds(env, "import matplotlib");
assert_command_execution_succeeds(env, "matplotlib.pyplot.arrow(2,3,4,5)");
deinit_environment();
// "import matplotlib.pyplot"
env = init_environement();
env = init_environnement();
assert_command_execution_fails(env, "matplotlib.pyplot.arrow(2,3,4,5)");
assert_command_execution_succeeds(env, "import matplotlib.pyplot");
assert_command_execution_succeeds(env, "matplotlib.pyplot.arrow(2,3,4,5)");
@@ -32,7 +32,7 @@ QUIZ_CASE(python_matplotlib_pyplot_import) {
}
QUIZ_CASE(python_matplotlib_pyplot_arrow) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "arrow(2,3,4,5)");
assert_command_execution_fails(env, "arrow(2,3,4,5, 0.1)");
@@ -45,7 +45,7 @@ QUIZ_CASE(python_matplotlib_pyplot_arrow) {
}
QUIZ_CASE(python_matplotlib_pyplot_axis) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "axis((2,3,4,5))");
assert_command_execution_succeeds(env, "axis([2,3,4,5])");
@@ -57,7 +57,7 @@ QUIZ_CASE(python_matplotlib_pyplot_axis) {
}
QUIZ_CASE(python_matplotlib_pyplot_bar) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "bar([0,2,3],[10,12,23])");
assert_command_execution_succeeds(env, "bar([0,2,3],10)");
@@ -71,7 +71,7 @@ QUIZ_CASE(python_matplotlib_pyplot_bar) {
}
QUIZ_CASE(python_matplotlib_pyplot_grid) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "grid(True)");
assert_command_execution_succeeds(env, "grid()");
@@ -79,7 +79,7 @@ QUIZ_CASE(python_matplotlib_pyplot_grid) {
}
QUIZ_CASE(python_matplotlib_pyplot_hist) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "hist([2,3,4,5,6])");
assert_command_execution_succeeds(env, "hist([2,3,4,5,6],23)");
@@ -91,7 +91,7 @@ QUIZ_CASE(python_matplotlib_pyplot_hist) {
}
QUIZ_CASE(python_matplotlib_pyplot_plot) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "plot([2,3,4,5,6])");
assert_command_execution_succeeds(env, "plot(2,3)");
@@ -103,7 +103,7 @@ QUIZ_CASE(python_matplotlib_pyplot_plot) {
}
QUIZ_CASE(python_matplotlib_pyplot_scatter) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "scatter(2,3)");
assert_command_execution_succeeds(env, "scatter([2,3,4,5,6],[3,4,5,6,7])");
@@ -114,7 +114,7 @@ QUIZ_CASE(python_matplotlib_pyplot_scatter) {
}
QUIZ_CASE(python_matplotlib_pyplot_text) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from matplotlib.pyplot import *");
assert_command_execution_succeeds(env, "text(2,3,'hello')");
assert_command_execution_succeeds(env, "show()");

View File

@@ -2,7 +2,7 @@
#include "execution_environment.h"
QUIZ_CASE(python_random) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "random()");
assert_command_execution_succeeds(env, "from random import *");
assert_command_execution_succeeds(env, "random()");

View File

@@ -2,7 +2,7 @@
#include "execution_environment.h"
QUIZ_CASE(python_time) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "monotonic()");
assert_command_execution_succeeds(env, "from time import *");
assert_command_execution_succeeds(env, "monotonic()");

View File

@@ -4,7 +4,7 @@
// TODO: to be completed
QUIZ_CASE(python_turtle) {
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_fails(env, "forward(3)");
assert_command_execution_succeeds(env, "from turtle import *");
assert_command_execution_succeeds(env, "reset()");
@@ -28,7 +28,7 @@ QUIZ_CASE(python_turtle) {
QUIZ_CASE(python_turtle_circle) {
// Turtle position should be unchanged after a complete circle
TestExecutionEnvironment env = init_environement();
TestExecutionEnvironment env = init_environnement();
assert_command_execution_succeeds(env, "from turtle import *");
assert_command_execution_succeeds(env, "goto(0,0)");
assert_command_execution_succeeds(env, "circle(28)");