Skip to content

Commit f5edbde

Browse files
committed
Fix typos as detected by the rust "typos" tool
1 parent ce4cc30 commit f5edbde

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs/src/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class of tokenization errors and lets the parser deal with them.
8080
* We use flags rather than child nodes to represent the difference between `struct` and `mutable struct`, `module` and `baremodule` (#220)
8181
* Iterations are represented with the `iteration` and `in` heads rather than `=` within the header of a `for`. Thus `for i=is ; body end` parses to `(for (iteration (in i is)) (block body))`. Cartesian iteration as in `for a=as, b=bs body end` are represented with a nested `(iteration (in a as) (in b bs))` rather than a `block` containing `=` because these lists of iterators are neither semantically nor syntactically a sequence of statements, unlike other uses of `block`. Generators also use the `iteration` head - see information on that below.
8282
* Short form functions like `f(x) = x + 1` are represented with the `function` head rather than the `=` head. In this case the `SHORT_FORM_FUNCTION_FLAG` flag is set to allow the surface syntactic form to be easily distinguished from long form functions.
83-
* All kinds of updating assignment operators like `+=` are represented with a single `K"op="` head, with the operator itself in infix position. For example, `x += 1` is `(op= x + 1)`, where the plus token is of kind `K"Identifer"`. This greatly reduces the number of distinct forms here from a rather big list (`$=` `%=` `&=` `*=` `+=` `-=` `//=` `/=` `<<=` `>>=` `>>>=` `\=` `^=` `|=` `÷=` `⊻=`) and makes the operator itself appear in the AST as kind `K"Identifier"`, as it should. It also makes it possible to add further unicode updating operators while keeping the AST stable.
83+
* All kinds of updating assignment operators like `+=` are represented with a single `K"op="` head, with the operator itself in infix position. For example, `x += 1` is `(op= x + 1)`, where the plus token is of kind `K"Identifier"`. This greatly reduces the number of distinct forms here from a rather big list (`$=` `%=` `&=` `*=` `+=` `-=` `//=` `/=` `<<=` `>>=` `>>>=` `\=` `^=` `|=` `÷=` `⊻=`) and makes the operator itself appear in the AST as kind `K"Identifier"`, as it should. It also makes it possible to add further unicode updating operators while keeping the AST stable.
8484

8585
## More detail on tree differences
8686

src/core/parse_stream.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ mutable struct ParseStream
269269
lexer = Tokenize.Lexer(io)
270270
# To avoid keeping track of the exact Julia development version where new
271271
# features were added or comparing prerelease strings, we treat prereleases
272-
# or dev versons as the release version using only major and minor version
272+
# or dev versions as the release version using only major and minor version
273273
# numbers. This means we're inexact for old dev versions but that seems
274274
# like an acceptable tradeoff.
275275
ver = (version.major, version.minor)

src/julia/parser.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ function parse_decl_with_initial_ex(ps::ParseState, mark)
14181418
# (x) -> y
14191419
# (x; a=1) -> y
14201420
elseif kb == K"where"
1421-
# `where` and `->` have the "wrong" precedence when writing anon functons.
1421+
# `where` and `->` have the "wrong" precedence when writing anon functions.
14221422
# So ignore this case to allow use of grouping brackets with `where`.
14231423
# This needs to worked around in lowering :-(
14241424
# (x where T) -> y ==> (-> (x where T) y)

test/diagnostics.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ end
244244
tempdirname = mktempdir()
245245
cd(tempdirname) do
246246
rm(tempdirname)
247-
# Test _file_url doesn't fail with nonexistant directories
248-
@test isnothing(JuliaSyntax._file_url(joinpath("__nonexistant__", "test.jl")))
247+
# Test _file_url doesn't fail with nonexistent directories
248+
@test isnothing(JuliaSyntax._file_url(joinpath("__nonexistent__", "test.jl")))
249249
end
250250
end
251251
end

test/parser.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ tests = [
300300
# `where` combined with `->` still parses strangely. However:
301301
# * It's extra hard to add a tuple around the `x` in this syntax corner case.
302302
# * The user already needs to add additional, ugly, parens to get this
303-
# to parse correctly because the precendence of `where` is
303+
# to parse correctly because the precedence of `where` is
304304
# inconsistent with `::` and `->` in this case.
305305
"(x where T)->c" => "(-> (parens (where x T)) c)"
306306
"((x::T) where T)->c" => "(-> (parens (where (parens (::-i x T)) T)) c)"
@@ -963,7 +963,7 @@ tests = [
963963
"[a \n b]" => "(vcat a b)"
964964
# Can't mix multiple ;'s and spaces
965965
((v=v"1.7",), "[a ;; b c]") => "(ncat-2 a (row b (error-t) c))"
966-
# Empty nd arrays
966+
# Empty N-dimensional arrays
967967
((v=v"1.8",), "[;]") => "(ncat-1)"
968968
((v=v"1.8",), "[;;]") => "(ncat-2)"
969969
((v=v"1.8",), "[\n ;; \n ]") => "(ncat-2)"

0 commit comments

Comments
 (0)