@@ -120,7 +120,7 @@ function term_matcher_constructor(term)
120120 car (matchers′)(term, bindings′) do b, n
121121 loop (drop_n (term, n), b, cdr (matchers′))
122122 end
123- # explenation of above 3 lines:
123+ # explanation of above 3 lines:
124124 # car(matchers′)(b,n -> loop(drop_n(term, n), b, cdr(matchers′)), term, bindings′)
125125 # <------ next(b,n) ---------------------------->
126126 # car = first element of list, cdr = rest of the list, drop_n = drop first n elements of list
@@ -138,15 +138,15 @@ end
138138# normal part (can bee a tree) operation defslot part
139139
140140# defslot_term_matcher works like this:
141- # checks wether data starts with the default operation.
141+ # checks whether data starts with the default operation.
142142# if yes (1): continues like term_matcher
143- # if no checks wether data matches the normal part
143+ # if no checks whether data matches the normal part
144144# if no returns nothing, rule is not applied
145145# if yes (2): adds the pair (default value name, default value) to the found bindings and
146146# calls the success function like term_matcher would do
147147
148148function defslot_term_matcher_constructor (term)
149- a = arguments (term) # lenght two bc defslot term matcher is allowed only with +,* and ^, that accept two arguments
149+ a = arguments (term) # length two bc defslot term matcher is allowed only with +,* and ^, that accept two arguments
150150 matchers = (matcher (operation (term)), map (matcher, a)... ) # create matchers for the operation and the two arguments of the term
151151
152152 defslot_index = findfirst (x -> isa (x, DefSlot), a) # find the defslot in the term
@@ -159,7 +159,7 @@ function defslot_term_matcher_constructor(term)
159159 if ! iscall (car (data)) || (iscall (car (data)) && nameof (operation (car (data))) != defslot. operation)
160160 other_part_matcher = matchers[defslot_index== 2 ? 2 : 3 ] # find the matcher of the normal part
161161
162- # checks wether it matches the normal part
162+ # checks whether it matches the normal part
163163 # <-----------------(2)------------------------------->
164164 bindings = other_part_matcher ((b,n) -> assoc (b, defslot. name, defslot. defaultValue), data, bindings)
165165
0 commit comments