Skip to content

Commit

Permalink
munged vars can also rarely be invalid identifiers (addendum to #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgpc42 committed Jan 14, 2023
1 parent ca59c72 commit a34059b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jmh/env.clj
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@

(defn- munge-method-suffix [b]
(let [s (munge (name (:name b (:fn b))))]
(if (or (not (:name b)) (java-identifier? s))
(if (java-identifier? s)
s
(throw (ex-info (format "benchmark name %s, after munging, is invalid identifier" (:name b))
(throw (ex-info (format "benchmark %s %s, after munging, is invalid identifier"
(if (:name b) "name" "var") (or (:name b) (:fn b)))
{:name (:name b), :munged s})))))

(defn finalize-benchmarks
Expand Down

0 comments on commit a34059b

Please sign in to comment.