File tree Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Original file line number Diff line number Diff line change 29
29
30
30
; ; ## Constructors
31
31
32
+ (defn- ->node
33
+ [t prefix sym children]
34
+ (node/assert-single-sexpr children)
35
+ (->QuoteNode t prefix sym children))
36
+
32
37
(defn quote-node
33
38
[children]
34
- (node/assert-single-sexpr children)
35
- (->QuoteNode
36
- :quote " '" 'quote
37
- children))
39
+ (if (sequential? children)
40
+ (->node
41
+ :quote " '" 'quote
42
+ children)
43
+ (recur [children])))
38
44
39
45
(defn syntax-quote-node
40
46
[children]
41
- (node/assert-single-sexpr children)
42
- (->QuoteNode
43
- :syntax-quote " `" 'quote
44
- children))
47
+ (if (sequential? children)
48
+ (->node
49
+ :syntax-quote " `" 'quote
50
+ children)
51
+ (recur [children])))
45
52
46
53
(defn unquote-node
47
54
[children]
48
- (node/assert-single-sexpr children)
49
- (->QuoteNode
50
- :unquote " ~" 'unquote
51
- children))
55
+ (if (sequential? children)
56
+ (->node
57
+ :unquote " ~" 'unquote
58
+ children)
59
+ (recur [children])))
52
60
53
61
(defn unquote-splicing-node
54
62
[children]
55
- (node/assert-single-sexpr children)
56
- (->QuoteNode
57
- :unquote-splicing " ~@" 'unquote-splicing
58
- children))
63
+ (if (sequential? children)
64
+ (->node
65
+ :unquote-splicing " ~@" 'unquote-splicing
66
+ children)
67
+ (recur [children])))
You can’t perform that action at this time.
0 commit comments