Skip to content

Commit 37a1b9c

Browse files
authored
Fix typos in comments and docs (#508)
Co-authored-by: spaette <[email protected]>
1 parent f21fb80 commit 37a1b9c

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed

docs/src/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ JuliaSyntax.kind
8282
```
8383

8484
In addition to the `kind`, a small integer set of "flags" is included to
85-
further distinguish details of each expresssion, accessed with the `flags`
85+
further distinguish details of each expression, accessed with the `flags`
8686
function. The kind and flags can be wrapped into a `SyntaxHead` which is
8787
accessed with the `head` function.
8888

docs/src/design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ parsing `key=val` pairs inside parentheses.
317317

318318
### Other oddities
319319

320-
* Operators with suffices don't seem to always be parsed consistently as the
320+
* Operators with suffixes don't seem to always be parsed consistently as the
321321
same operator without a suffix. Unclear whether this is by design or mistake.
322322
For example, `[x +y] ==> (hcat x (+ y))`, but `[x +₁y] ==> (hcat (call +₁ x y))`
323323

@@ -425,7 +425,7 @@ First, there's no support for precise source locations and the existing data
425425
structures (bare flisp lists) can't easily be extended to add these. Fixing
426426
this would require changes to nearly all of the code.
427427

428-
Second, it's written in flisp: an aestheically pleasing, minimal but obscure
428+
Second, it's written in flisp: an aesthetically pleasing, minimal but obscure
429429
implementation of Scheme. Learning Scheme is actually a good way to appreciate
430430
some of Julia's design inspiration, but it's quite a barrier for developers of
431431
Julia language tooling. (Flisp has no user-level documentation but non-schemers

docs/src/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class of tokenization errors and lets the parser deal with them.
7373

7474
### Improvements to awkward AST forms
7575

76-
* Frakentuples with multiple parameter blocks like `(a=1, b=2; c=3; d=4)` are flattened into the parent tuple instead of using nested `K"parameters"` nodes (#133)
76+
* `FrankenTuple`s with multiple parameter blocks like `(a=1, b=2; c=3; d=4)` are flattened into the parent tuple instead of using nested `K"parameters"` nodes (#133)
7777
* Using `try catch else finally end` is parsed with `K"catch"` `K"else"` and `K"finally"` children to avoid the awkwardness of the optional child nodes in the `Expr` representation (#234)
7878
* The dotted import path syntax as in `import A.b.c` is parsed with a `K"importpath"` kind rather than `K"."`, because a bare `A.b.c` has a very different nested/quoted expression representation (#244)
7979
* We use flags rather than child nodes to represent the difference between `struct` and `mutable struct`, `module` and `baremodule` (#220)

src/expr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function _internal_node_to_Expr(source, srcrange, head, childranges, childheads,
440440
a1 = args[1]
441441
if @isexpr(a1, :block)
442442
a1a = (args[1]::Expr).args
443-
# Ugly logic to strip the Expr(:block) in certian cases for compatibility
443+
# Ugly logic to strip the Expr(:block) in certain cases for compatibility
444444
if length(a1a) == 1
445445
a = a1a[1]
446446
if a isa Symbol || @isexpr(a, :(=)) || @isexpr(a, :(::))

src/green_tree.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ As implementation choices, we choose that:
1212
1313
* Nodes are immutable and don't know their parents or absolute position, so can
1414
be cached and reused
15-
* Nodes are homogenously typed at the language level so they can be stored
15+
* Nodes are homogeneously typed at the language level so they can be stored
1616
concretely, with the `head` defining the node type. Normally this would
1717
include a "syntax kind" enumeration, but it can also include flags and record
1818
information the parser knew about the layout of the child nodes.

src/kinds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Register custom `Kind`s with the given `names`, belonging to a module `mod`.
135135
`names` is an array of arbitrary strings.
136136
137137
In order for kinds to be represented by a small number of bits, some nontrivial
138-
cooperation is reqired between modules using custom kinds:
138+
cooperation is required between modules using custom kinds:
139139
* The integer `module_id` is globally unique for each `mod` which will be used
140140
together, and not larger than $_kind_module_id_max.
141141
* No two modules register the same `name`. The semantics of a given `kind` name

src/parse_stream.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#-------------------------------------------------------------------------------
2-
# Flags hold auxilary information about tokens/nonterminals which the Kind
2+
# Flags hold auxiliary information about tokens/nonterminals which the Kind
33
# doesn't capture in a nice way.
44
#
55
# TODO: Use `primitive type SyntaxFlags 16 end` rather than an alias?
@@ -40,7 +40,7 @@ Set for K"tuple", K"block" or K"macrocall" which are delimited by parentheses
4040
const PARENS_FLAG = RawFlags(1<<5)
4141

4242
"""
43-
Set for K"quote" for the short form `:x` as oppsed to long form `quote x end`
43+
Set for K"quote" for the short form `:x` as opposed to long form `quote x end`
4444
"""
4545
const COLON_QUOTE = RawFlags(1<<5)
4646

@@ -223,7 +223,7 @@ is_dotted(x) = has_flags(x, DOTOP_FLAG)
223223
"""
224224
is_suffixed(x)
225225
226-
Return true for operators which have sufficies, such as `+₁`
226+
Return true for operators which have suffixes, such as `+₁`
227227
"""
228228
is_suffixed(x) = has_flags(x, SUFFIXED_FLAG)
229229

@@ -822,7 +822,7 @@ end
822822
Bump an invisible zero-width token into the output
823823
824824
This is useful when surrounding syntax implies the presence of a token. For
825-
example, `2x` means `2*x` via the juxtoposition rules.
825+
example, `2x` means `2*x` via the juxtaposition rules.
826826
"""
827827
function bump_invisible(stream::ParseStream, kind, flags=EMPTY_FLAGS;
828828
error=nothing)

src/parser.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ function parse_cond(ps::ParseState)
723723
# FIXME: This is a very specific case. Error recovery should be handled more
724724
# generally elsewhere.
725725
if is_block_continuation_keyword(ps, kind(t))
726-
# a "continuaton keyword" is likely to belong to the surrounding code, so
726+
# a "continuation keyword" is likely to belong to the surrounding code, so
727727
# we abort early
728728

729729
# if true; x ? true elseif true end ==> (if true (block (if x true (error-t) (error-t))) (elseif true (block)))
@@ -1472,7 +1472,7 @@ function parse_unary_prefix(ps::ParseState)
14721472
end
14731473
end
14741474

1475-
# Parses a chain of sufficies at function call precedence, leftmost binding
1475+
# Parses a chain of suffixes at function call precedence, leftmost binding
14761476
# tightest. This handles
14771477
# * Bracketed calls like a() b[] c{}
14781478
# * Field access like a.b.c
@@ -1722,7 +1722,7 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
17221722
# x`str` ==> (macrocall @x_cmd (cmdstring-r "str"))
17231723
# x"" ==> (macrocall @x_str (string-r ""))
17241724
# x`` ==> (macrocall @x_cmd (cmdstring-r ""))
1725-
# Triple quoted procesing for custom strings
1725+
# Triple quoted processing for custom strings
17261726
# r"""\nx""" ==> (macrocall @r_str (string-s-r "x"))
17271727
# r"""\n x\n y""" ==> (macrocall @r_str (string-s-r "x\n" "y"))
17281728
# r"""\n x\\n y""" ==> (macrocall @r_str (string-s-r "x\\\n" "y"))
@@ -1735,7 +1735,7 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
17351735
t = peek_token(ps)
17361736
k = kind(t)
17371737
if !preceding_whitespace(t) && is_string_macro_suffix(k)
1738-
# Macro sufficies can include keywords and numbers
1738+
# Macro suffixes can include keywords and numbers
17391739
# x"s"y ==> (macrocall @x_str (string-r "s") "y")
17401740
# x"s"end ==> (macrocall @x_str (string-r "s") "end")
17411741
# x"s"in ==> (macrocall @x_str (string-r "s") "in")
@@ -3484,7 +3484,7 @@ function parse_atom(ps::ParseState, check_identifiers=true)
34843484
end
34853485
emit(ps, mark, K"char")
34863486
elseif leading_kind == K"Char"
3487-
# FIXME: This is a tokenization error and should be preceeded with
3487+
# FIXME: This is a tokenization error and should be preceded with
34883488
# K"'". However this workaround is better than emitting a bare Char.
34893489
bump(ps, remap_kind=K"Identifier")
34903490
elseif leading_kind == K":"

src/parser_api.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Token type resulting from calling `tokenize(text)`
161161
162162
Use
163163
* `kind(tok)` to get the token kind
164-
* `untokenize(tok, text)` to retreive the text
164+
* `untokenize(tok, text)` to retrieve the text
165165
* Predicates like `is_error(tok)` to query token categories and flags
166166
"""
167167
struct Token
@@ -177,7 +177,7 @@ head(t::Token) = t.head
177177
tokenize(text)
178178
179179
Returns the tokenized UTF-8 encoded `text` as a vector of `Token`s. The
180-
text for the token can be retreived by using `untokenize()`. The full text can be
180+
text for the token can be retrieved by using `untokenize()`. The full text can be
181181
reconstructed with, for example, `join(untokenize.(tokenize(text), text))`.
182182
183183
This interface works on UTF-8 encoded string or buffer data only.

src/source_files.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ second form, get the line number at the given `byte_index` within `source`.
7070
source_line(x) = source_line(sourcefile(x), first_byte(x))
7171

7272
"""
73-
souce_location(x)
74-
souce_location(source::SourceFile, byte_index::Integer)
73+
source_location(x)
74+
source_location(source::SourceFile, byte_index::Integer)
7575
76-
souce_location(LineNumberNode, x)
77-
souce_location(LineNumberNode, source, byte_index)
76+
source_location(LineNumberNode, x)
77+
source_location(LineNumberNode, source, byte_index)
7878
7979
Get `(line,column)` of the first byte where object `x` appears in the source.
8080
The second form allows one to be more precise with the `byte_index`, given the
8181
source file.
8282
83-
Providing `LineNumberNode` as the first agrument will return the line and file
83+
Providing `LineNumberNode` as the first argument will return the line and file
8484
name in a line number node object.
8585
"""
8686
source_location(x) = source_location(sourcefile(x), first_byte(x))
@@ -373,7 +373,7 @@ function highlight(io::IO, source::SourceFile, range::UnitRange;
373373
# The diagnostic range is compact and we show the whole thing
374374
_printstyled(io, source[p:q]; bgcolor=color)
375375
else
376-
# Or large and we trucate the code to show only the region around the
376+
# Or large and we truncate the code to show only the region around the
377377
# start and end of the error.
378378
_printstyled(io, source[p:y]; bgcolor=color)
379379
print(io, "\n")

0 commit comments

Comments
 (0)