Skip to content

Commit 97c84a9

Browse files
committed
improved pretty print of rules[skip ci]
1 parent f6df29b commit 97c84a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/string_manipulation_helpers.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ readable way
366366
"""
367367
function pretty_print_rule(rule, identifier)
368368
# manage special cases
369-
identifier == "0_1_0" && return "∫( +(a...), x) => sum([ ∫(f, x) for f in a ])"
369+
identifier == "0_1_0" && return "∫( a + b + ..., x) => ∫(a,x) + ∫(b,x) + ..."
370370
identifier == "0_1_12" && return "∫ a*f(x) dx => a*∫ f(x) dx"
371371

372372
s = string(rule)
@@ -410,6 +410,9 @@ function pretty_print_rule(rule, identifier)
410410
s = replace(s, r".*#=.*=#.*\n" => "")
411411
# manage functions from other packages
412412
s = replace(s, "SymbolicUtils."=>"")
413+
# manages eq function
414+
s = replace(s, r"!\(eq\((.*?)\s*,\s*(.*?)\)\)"=>s"\1 !== \2")
415+
s = replace(s, r"eq\((.*?)\s*,\s*(.*?)\)"=>s"\1 == \2")
413416

414417
return s
415418
end

0 commit comments

Comments
 (0)