diff --git a/bench/chaos/chaos.codon b/bench/chaos/chaos.codon index 5a4b29de..075d4a4e 100644 --- a/bench/chaos/chaos.codon +++ b/bench/chaos/chaos.codon @@ -232,7 +232,7 @@ class Chaosgame(object): def create_image_chaos(self, w, h, iterations, filename, rng_seed): # Always use the same sequence of random numbers - # to get reproductible benchmark + # to get reproducible benchmark random.seed(rng_seed) im = [[1] * h for i in range(w)] diff --git a/bench/chaos/chaos.py b/bench/chaos/chaos.py index e00a4512..71f4ed88 100644 --- a/bench/chaos/chaos.py +++ b/bench/chaos/chaos.py @@ -212,7 +212,7 @@ class Chaosgame(object): def create_image_chaos(self, w, h, iterations, filename, rng_seed): # Always use the same sequence of random numbers - # to get reproductible benchmark + # to get reproducible benchmark random.seed(rng_seed) im = [[1] * h for i in range(w)] diff --git a/codon/cir/analyze/dataflow/capture.cpp b/codon/cir/analyze/dataflow/capture.cpp index 11b6699f..fe02b9bc 100644 --- a/codon/cir/analyze/dataflow/capture.cpp +++ b/codon/cir/analyze/dataflow/capture.cpp @@ -300,7 +300,7 @@ struct CaptureContext { }; // This visitor answers the questions of what vars are -// releavant to track in a capturing expression. For +// relevant to track in a capturing expression. For // example, in "a[i] = x", the expression "a[i]" captures // "x"; in this case we need to track "a" but the variable // "i" (typically) we would not care about. diff --git a/codon/parser/ast/expr.cpp b/codon/parser/ast/expr.cpp index c7947a78..01bad6fa 100644 --- a/codon/parser/ast/expr.cpp +++ b/codon/parser/ast/expr.cpp @@ -387,16 +387,16 @@ CallExpr::CallExpr(ExprPtr expr, std::vector args) validate(); } void CallExpr::validate() const { - bool namesStarted = false, foundEllispis = false; + bool namesStarted = false, foundEllipsis = false; for (auto &a : args) { if (a.name.empty() && namesStarted && !(CAST(a.value, KeywordStarExpr) || a.value->getEllipsis())) E(Error::CALL_NAME_ORDER, a.value); if (!a.name.empty() && (a.value->getStar() || CAST(a.value, KeywordStarExpr))) E(Error::CALL_NAME_STAR, a.value); - if (a.value->getEllipsis() && foundEllispis) + if (a.value->getEllipsis() && foundEllipsis) E(Error::CALL_ELLIPSIS, a.value); - foundEllispis |= bool(a.value->getEllipsis()); + foundEllipsis |= bool(a.value->getEllipsis()); namesStarted |= !a.name.empty(); } } diff --git a/codon/parser/ast/stmt.h b/codon/parser/ast/stmt.h index 3ec6c1e1..b7e57f1b 100644 --- a/codon/parser/ast/stmt.h +++ b/codon/parser/ast/stmt.h @@ -383,7 +383,7 @@ struct TryStmt : public Stmt { struct ThrowStmt : public Stmt { ExprPtr expr; // True if a statement was transformed during type-checking stage - // (to avoid setting up ExcHeader multuple times). + // (to avoid setting up ExcHeader multiple times). bool transformed; explicit ThrowStmt(ExprPtr expr, bool transformed = false); diff --git a/codon/parser/peg/grammar.peg b/codon/parser/peg/grammar.peg index 9aef1b9e..176248bd 100644 --- a/codon/parser/peg/grammar.peg +++ b/codon/parser/peg/grammar.peg @@ -1,6 +1,6 @@ # Copyright (C) 2022 Exaloop Inc. # Codon PEG grammar -# Adpoted from Python 3's PEG grammar (https://docs.python.org/3/reference/grammar.html) +# Adopted from Python 3's PEG grammar (https://docs.python.org/3/reference/grammar.html) # TODO: nice docstrs diff --git a/codon/parser/visitors/simplify/access.cpp b/codon/parser/visitors/simplify/access.cpp index 5013c4a8..99fe50ed 100644 --- a/codon/parser/visitors/simplify/access.cpp +++ b/codon/parser/visitors/simplify/access.cpp @@ -238,7 +238,7 @@ SimplifyVisitor::getImport(const std::vector &chain) { for (auto i = chain.size(); i-- > importEnd;) { if (fctx->getModule() == "std.python" && importEnd < chain.size()) { // Special case: importing from Python. - // Fake SimplifyItem that inidcates std.python access + // Fake SimplifyItem that indicates std.python access val = std::make_shared(SimplifyItem::Var, "", "", fctx->getModule(), std::vector{}); return {importEnd, val}; diff --git a/codon/parser/visitors/typecheck/call.cpp b/codon/parser/visitors/typecheck/call.cpp index abade182..4e9f391f 100644 --- a/codon/parser/visitors/typecheck/call.cpp +++ b/codon/parser/visitors/typecheck/call.cpp @@ -770,7 +770,7 @@ ExprPtr TypecheckVisitor::transformStaticLen(CallExpr *expr) { } /// Transform hasattr method to a static boolean expression. -/// This method also supports supports additional argument types that are used to check +/// This method also supports additional argument types that are used to check /// for a matching overload (not available in Python). ExprPtr TypecheckVisitor::transformHasAttr(CallExpr *expr) { expr->staticValue.type = StaticValue::INT; diff --git a/docs/advanced/ir.md b/docs/advanced/ir.md index 38131144..5c4fb9f9 100644 --- a/docs/advanced/ir.md +++ b/docs/advanced/ir.md @@ -239,7 +239,7 @@ public: const std::string ValidateFoo::KEY = "validate-foo"; ``` -Note that `insertAfter` is a conveience method of `Operator` that inserts the given node "after" the node +Note that `insertAfter` is a convenience method of `Operator` that inserts the given node "after" the node being visited (along with `insertBefore` which inserts *before* the node being visited). Running this pass on the snippet above, we would get: diff --git a/docs/advanced/parallel.md b/docs/advanced/parallel.md index 36a08544..9e7b6db2 100644 --- a/docs/advanced/parallel.md +++ b/docs/advanced/parallel.md @@ -177,7 +177,7 @@ module: ``` python from threading import Lock -lock = Lock() # or RLock for re-entrant lock +lock = Lock() # or RLock for reentrant lock @par for i in range(100): diff --git a/docs/intro/faq.md b/docs/intro/faq.md index 047e3766..5ac32284 100644 --- a/docs/intro/faq.md +++ b/docs/intro/faq.md @@ -103,7 +103,7 @@ after 3 years. ## How can I use Codon for production or commercial use? -Please reach out to [info@exaloop.io](mailto:info@exaloop.io) to inquire about about a +Please reach out to [info@exaloop.io](mailto:info@exaloop.io) to inquire about a production-use license. # Contributing diff --git a/stdlib/statistics.codon b/stdlib/statistics.codon index 3f258aba..4b02fb6c 100644 --- a/stdlib/statistics.codon +++ b/stdlib/statistics.codon @@ -151,7 +151,7 @@ def quantiles( Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set *n* to 100 for percentiles which gives the 99 cuts points that - separate *data* in to 100 equal sized groups. + separate *data* into 100 equal sized groups. The *data* can be any iterable containing sample. The cut points are linearly interpolated between data points. @@ -190,7 +190,7 @@ def quantiles( def _lcm(x: int, y: int): """ - Returns the lowest common multiple bewteen x and y + Returns the lowest common multiple between x and y """ greater = 0 if x > y: @@ -563,7 +563,7 @@ class NormalDist: Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set *n* to 100 for percentiles which gives the 99 cuts points that - separate the normal distribution in to 100 equal sized groups. + separate the normal distribution into 100 equal sized groups. """ return [self.inv_cdf(float(i) / float(n)) for i in range(1, n)] diff --git a/test/parser/types.codon b/test/parser/types.codon index a9aa9228..371df2f4 100644 --- a/test/parser/types.codon +++ b/test/parser/types.codon @@ -1023,7 +1023,7 @@ print list(foo(*args)) == result #: False #%% type_error_reporting -# TODO: imporove this certainly +# TODO: improve this certainly def tee(iterable, n=2): from collections import deque it = iter(iterable) @@ -1160,7 +1160,7 @@ print t(6, Optional(1)) #! 'Optional[int]' does not match expected type 'Optiona #%% traits_error_2,barebones z: Callable[[int],int] = 4 #! 'Callable[[int],int]' does not match expected type 'int' -#%% assign_wrapers,barebones +#%% assign_wrappers,barebones a = 1.5 print a #: 1.5 if 1: diff --git a/test/stdlib/itertools_test.codon b/test/stdlib/itertools_test.codon index 7159d04c..081f1c4a 100644 --- a/test/stdlib/itertools_test.codon +++ b/test/stdlib/itertools_test.codon @@ -84,9 +84,9 @@ def test_combinations(): [0, 2, 3], [1, 2, 3], ] - test_intermediat = itertools.combinations(range(4), 3) - next(test_intermediat) - assert list(test_intermediat) == [[0, 1, 3], [0, 2, 3], [1, 2, 3]] + test_intermediate = itertools.combinations(range(4), 3) + next(test_intermediate) + assert list(test_intermediate) == [[0, 1, 3], [0, 2, 3], [1, 2, 3]] @test diff --git a/test/stdlib/statistics_test.codon b/test/stdlib/statistics_test.codon index 5646085f..a64840a2 100644 --- a/test/stdlib/statistics_test.codon +++ b/test/stdlib/statistics_test.codon @@ -393,7 +393,7 @@ test_inv_cdf() @test -def test_ND_qualtiles(): +def test_ND_quartiles(): PRECISION = 1e-6 Z = statistics.NormalDist(0.0, 1.0) for n, expected in [ @@ -406,7 +406,7 @@ def test_ND_qualtiles(): assert math.fabs(actual[i] - expected[i]) < PRECISION -test_ND_qualtiles() +test_ND_quartiles() @test