Skip to content

Commit

Permalink
Clojure: Fix skipMetadata not called for functions (#2728)
Browse files Browse the repository at this point in the history
* Clojure: Fix skipMetadata not called for functions

* Units(Clojure): Add tests clojure-metadata-in-fn

* Units(Clojure): Fix input.clj path for test clojure-metadata-in-fn
  • Loading branch information
Cnly authored Nov 25, 2020
1 parent 42f590c commit c18ddfa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Units/parser-clojure.r/clojure-metadata-in-fn.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
my-fn input.clj /^(defn my-fn [])$/;" f
my-hinted-fn input.clj /^(defn my-hinted-fn ^MyReturnType [])$/;" f
my-private-fn input.clj /^(defn ^:private my-private-fn [])$/;" f
my-private-hinted-fn input.clj /^(defn ^:private my-private-hinted-fn ^MyReturnType [])$/;" f
my-public-fn input.clj /^(defn ^{:foo :bar} my-public-fn [])$/;" f
so-many-hints input.clj /^(defn ^:private so-many-hints ^MyReturnType$/;" f
12 changes: 12 additions & 0 deletions Units/parser-clojure.r/clojure-metadata-in-fn.d/input.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(defn my-fn [])

(defn ^:private my-private-fn [])

(defn ^{:foo :bar} my-public-fn [])

(defn my-hinted-fn ^MyReturnType [])

(defn ^:private my-private-hinted-fn ^MyReturnType [])

(defn ^:private so-many-hints ^MyReturnType
[^MyArgType x])
1 change: 1 addition & 0 deletions parsers/clojure.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static int makeNamespaceTag (vString * const name, const char *dbp)

static void makeFunctionTag (vString * const name, const char *dbp, int scope_index)
{
dbp = skipMetadata (dbp);
functionName (name, dbp);
if (vStringLength (name) > 0 && ClojureKinds[K_FUNCTION].enabled)
{
Expand Down

0 comments on commit c18ddfa

Please sign in to comment.