Skip to content

Commit a761eaf

Browse files
committed
Allow fullqualified function definition
1 parent f76ed53 commit a761eaf

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
another.name input.clj /^(ns another.name)$/;" n
22
app.controller input.clj /^(ns app.controller)$/;" n
3+
core-function-with-body input.clj /^(clojure.core\/defn core-function-with-body []$/;" f namespace:app.controller
34
empty-fn input.clj /^ (defn empty-fn [])$/;" f namespace:app.controller
45
function-with-body input.clj /^(defn function-with-body []$/;" f namespace:app.controller
56
x input.clj /^(defn x [])$/;" f namespace:another.name

Units/parser-clojure.r/simple-clojure.d/input.clj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
(defn function-with-body []
66
(println "body"))
77

8+
(clojure.core/defn core-function-with-body []
9+
(println "core"))
10+
811
'(defn quoted-function [])
912
(quote quoted-function2 [])
1013

parsers/clojure.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ static int isNamespace (const char *strp)
3434

3535
static int isFunction (const char *strp)
3636
{
37-
return strncmp (++strp, "defn", 4) == 0 && isspace (strp[4]);
37+
return (strncmp (++strp, "defn", 4) == 0 && isspace (strp[4])); // || (strncmp (++strp, "clojure.core/defn", 17) == 0 && isspace (strp[17]));
38+
}
39+
40+
static int isCoreFunction (const char *strp)
41+
{
42+
return (strncmp (++strp, "clojure.core/defn", 17) == 0 && isspace (strp[17]));
3843
}
3944

4045
static int isQuote (const char *strp)
@@ -154,7 +159,7 @@ static void findClojureTags (void)
154159
skipToSymbol (&p);
155160
scope_index = makeNamespaceTag (name, p);
156161
}
157-
else if (isFunction (p))
162+
else if (isFunction (p) || isCoreFunction (p))
158163
{
159164
skipToSymbol (&p);
160165
makeFunctionTag (name, p, scope_index);

0 commit comments

Comments
 (0)