Skip to content

Commit 17c3995

Browse files
green-coderbronsa
authored andcommitted
TANAL-135: Docstring clarification + fixed typos + fixed 1 indentation
1 parent e71c533 commit 17c3995

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ clojure.tools.analyzer.jvm> (ast/update-children (analyze '(do 1 (+ 1 2) :foo))
148148
...},
149149
...}
150150
```
151-
If it's desiderable to walk all the AST applying a function to all the nodes and the children nodes, one of `walk`, `prewalk` or `postwalk` should be used, read the docstrings of the three functions to understand the differences.
151+
If it's desirable to walk all the AST applying a function to all the nodes and the children nodes, one of `walk`, `prewalk` or `postwalk` should be used, read the docstrings of the three functions to understand the differences.
152152
Here's the previous example using `prewalk` instead of `update-children`:
153153
```clojure
154154
clojure.tools.analyzer.jvm> (ast/prewalk (analyze '(do 1 (+ 1 2) :foo))

src/main/clojure/clojure/tools/analyzer.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
* :form the form represented by the AST node
103103
* :env the environment map of the AST node
104104
105-
Additionaly if the AST node contains sub-nodes, it is guaranteed to have:
105+
Additionally if the AST node contains sub-nodes, it is guaranteed to have:
106106
* :children a vector of the keys of the AST node mapping to the sub-nodes,
107107
ordered, when that makes sense
108108

src/main/clojure/clojure/tools/analyzer/ast.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(:require [clojure.tools.analyzer.utils :refer [into! rseqv mapv']]))
1313

1414
(defn cycling
15-
"Combine the given passes in a single pass that will be applieed repeatedly
15+
"Combine the given passes in a single pass that will be applied repeatedly
1616
to the AST until applying it another time will have no effect"
1717
[& fns*]
1818
(let [fns (cycle fns*)]
@@ -26,7 +26,7 @@
2626
(defn children*
2727
"Return a vector of vectors of the children node key and the children expression
2828
of the AST node, if it has any.
29-
The returned vector returns the childrens in the order as they appear in the
29+
The returned vector returns the children in the order as they appear in the
3030
:children field of the AST, and the children expressions may be either a node
3131
or a vector of nodes."
3232
[{:keys [children] :as ast}]

src/main/clojure/clojure/tools/analyzer/ast/query.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Given a Datomic query, walk the :where clauses searching for
3030
expression clauses with nested calls, unnesting those calls.
3131
32-
E.g {:where [[(inc (dec ?foo)) ?bar] ..] ..} will be transformed in
32+
E.g {:where [[(inc (dec ?foo)) ?bar] ..] ..} will be transformed into
3333
{:where [[(dec ?foo) ?1234] [(inc ?1234) ?bar] ..] ..}"
3434
[query]
3535
(let [{:keys [where] :as query} (query-map query)]

src/main/clojure/clojure/tools/analyzer/env.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
(:refer-clojure :exclude [ensure]))
1111

1212
(def ^:dynamic *env*
13-
"Global env atom
13+
"Global env atom containing a map.
1414
Required options:
15-
* :namespaces an atom containing a map from namespace symbol to namespace map,
15+
* :namespaces a map from namespace symbol to namespace map,
1616
the namespace map contains at least the following keys:
1717
** :mappings a map of mappings of the namespace, symbol to var/class
1818
** :aliases a map of the aliases of the namespace, symbol to symbol

src/main/clojure/clojure/tools/analyzer/passes.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* the remaining scheduler state
6666
6767
E.g. given:
68-
[{:walk :any .. } {:walk :pre ..} {:walk :post ..} {:walk :pre ..}]
68+
[{:walk :any ..} {:walk :pre ..} {:walk :post ..} {:walk :pre ..}]
6969
it will return:
7070
[:pre [{:walk :any ..} {:walk :pre ..}] [{:walk :post ..} {:walk :pre ..}]]"
7171
[state]

src/test/clojure/clojure/tools/analyzer/core_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
(= (first opname) \.) ; (.foo bar ..)
1616
(let [[target & args] expr
1717
args (list* (symbol (subs opname 1)) args)]
18-
(with-meta (list '. target (if (= 1 (count args)) ;; we don't know if (.foo bar) ia
18+
(with-meta (list '. target (if (= 1 (count args)) ;; we don't know if (.foo bar) is
1919
(first args) args)) ;; a method call or a field access
2020
(meta form)))
2121

@@ -36,7 +36,7 @@
3636
(:macro (meta v)))
3737
(apply v form env (rest form)) ; (m &form &env & args)
3838
(desugar-host-expr form)))))
39-
form))
39+
form))
4040

4141
(defmacro foo [] 1)
4242

0 commit comments

Comments
 (0)