Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions src/clj_stacktrace/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,34 @@
;; drop any __xyz suffixes
;; sub _PLACEHOLDER_ for the corresponding char
(def clojure-fn-subs
[[#"^[^$]*\$" ""]
[#"\$.*" ""]
[#"__\d+.*" ""]
[#"_QMARK_" "?"]
[#"_BANG_" "!"]
[#"_PLUS_" "+"]
[#"_GT_" ">"]
[#"_LT_" "<"]
[#"_EQ_" "="]
[#"_STAR_" "*"]
[#"_SLASH_" "/"]
[#"_" "-"]])
[[#"^[^$]*\$" ""]
[#"\$.*" ""]
[#"__\d+.*" ""]
[#"_AMPERSAND_" "&"]
[#"_BANG_" "!"]
[#"_BAR_" "|"]
[#"_BSLASH_" "\\"]
[#"_CARET_" "^"]
[#"_CIRCA_" "@"]
[#"_COLON_" ":"]
[#"_DOT_" "."]
[#"_DOUBLEQUOTE_" "\""]
[#"_EQ_" "="]
[#"_GT_" ">"]
[#"_LBRACE_" "{"]
[#"_LBRACK_" "["]
[#"_LT_" "<"]
[#"_PERCENT_" "%"]
[#"_PLUS_" "+"]
[#"_QMARK_" "?"]
[#"_RBRACE_" "}"]
[#"_RBRACK_" "]"]
[#"_SHARP_" "#"]
[#"_SINGLEQUOTE_" "'"]
[#"_SLASH_" "/"]
[#"_STAR_" "*"]
[#"_TILDE_" "~"]
[#"_" "-"]])

(defn- clojure-fn
"Returns the clojure function name implied by the bytecode class name."
Expand Down
8 changes: 8 additions & 0 deletions test/clj_stacktrace/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
{:clojure true :ns "foo.bar" :fn "biz-bat?"
:file "bar.clj" :line 456 :anon-fn true}]

["foo.bar$biz_SINGLEQUOTE__bar__448" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz'-bar"
:file "bar.clj" :line 456 :anon-fn false}]

["foo.bar$biz_DOT_bat__448" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz.bat"
:file "bar.clj" :line 456 :anon-fn false}]

["foo.bar$repl$fn__5629.invoke" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "repl"
:file "bar.clj" :line 456 :anon-fn true}]
Expand Down