Skip to content

Commit

Permalink
Spelling (#276)
Browse files Browse the repository at this point in the history
* spelling: about

Signed-off-by: Josh Soref <[email protected]>

* spelling: adopted

Signed-off-by: Josh Soref <[email protected]>

* spelling: between

Signed-off-by: Josh Soref <[email protected]>

* spelling: convenience

Signed-off-by: Josh Soref <[email protected]>

* spelling: ellipsis

Signed-off-by: Josh Soref <[email protected]>

* spelling: improve

Signed-off-by: Josh Soref <[email protected]>

* spelling: indicates

Signed-off-by: Josh Soref <[email protected]>

* spelling: intermediate

Signed-off-by: Josh Soref <[email protected]>

* spelling: into

Signed-off-by: Josh Soref <[email protected]>

* spelling: multiple

Signed-off-by: Josh Soref <[email protected]>

* spelling: quartiles

Signed-off-by: Josh Soref <[email protected]>

* spelling: reentrant

Signed-off-by: Josh Soref <[email protected]>

* spelling: relevant

Signed-off-by: Josh Soref <[email protected]>

* spelling: supports

Signed-off-by: Josh Soref <[email protected]>

* spelling: reproducible

Signed-off-by: Josh Soref <[email protected]>

* spelling: wrappers

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Mar 20, 2023
1 parent 2d20e1b commit e5e19a6
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bench/chaos/chaos.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion bench/chaos/chaos.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def truncate(self, point):

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)]
Expand Down
2 changes: 1 addition & 1 deletion codon/cir/analyze/dataflow/capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions codon/parser/ast/expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,16 @@ CallExpr::CallExpr(ExprPtr expr, std::vector<ExprPtr> 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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/ast/stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/peg/grammar.peg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2022 Exaloop Inc. <https://exaloop.io>
# 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

Expand Down
2 changes: 1 addition & 1 deletion codon/parser/visitors/simplify/access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ SimplifyVisitor::getImport(const std::vector<std::string> &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>(SimplifyItem::Var, "", "",
fctx->getModule(), std::vector<int>{});
return {importEnd, val};
Expand Down
2 changes: 1 addition & 1 deletion codon/parser/visitors/typecheck/call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/ir.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ after 3 years.

## How can I use Codon for production or commercial use?

Please reach out to [[email protected]](mailto:[email protected]) to inquire about about a
Please reach out to [[email protected]](mailto:[email protected]) to inquire about a
production-use license.

# Contributing
Expand Down
6 changes: 3 additions & 3 deletions stdlib/statistics.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)]

Expand Down
4 changes: 2 additions & 2 deletions test/parser/types.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions test/stdlib/itertools_test.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/stdlib/statistics_test.codon
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand All @@ -406,7 +406,7 @@ def test_ND_qualtiles():
assert math.fabs(actual[i] - expected[i]) < PRECISION


test_ND_qualtiles()
test_ND_quartiles()


@test
Expand Down

0 comments on commit e5e19a6

Please sign in to comment.