Skip to content

Commit f0a9bcd

Browse files
committed
changed order of checks in pow term matcher
1 parent 860aa70 commit f0a9bcd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/matchers.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ function term_matcher_constructor(term, acSets)
133133
data = car(data) # from (..., ) to ...
134134
!iscall(data) && return nothing # if first element is not a call, return nothing
135135

136-
result = loop(data, bindings, matchers)
137-
result !== nothing && return success(result, 1)
138-
139136
# if data is of the alternative form (1/...)^(...), it might match with negative exponent
140137
if (operation(data) === ^) && iscall(arguments(data)[1]) && (operation(arguments(data)[1]) === /) && isequal(arguments(arguments(data)[1])[1], 1)
141138
one_over_smth = arguments(data)[1]
@@ -144,6 +141,10 @@ function term_matcher_constructor(term, acSets)
144141
result = loop(frankestein, bindings, matchers)
145142
result !== nothing && return success(result, 1)
146143
end
144+
145+
result = loop(data, bindings, matchers)
146+
result !== nothing && return success(result, 1)
147+
147148
# if data is of the alternative form 1/(...)^(...), it might match with negative exponent
148149
if (operation(data) === /) && isequal(arguments(data)[1], 1) && iscall(arguments(data)[2]) && (operation(arguments(data)[2]) === ^)
149150
denominator = arguments(data)[2]

0 commit comments

Comments
 (0)