From a0cb1a80dd61428de8046cee25e664b41156e6ab Mon Sep 17 00:00:00 2001 From: hlaaf Date: Wed, 6 Jun 2018 00:36:56 +0300 Subject: Allow `%` overloading in `%*` macro in json (again) --- lib/pure/json.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/pure') diff --git a/lib/pure/json.nim b/lib/pure/json.nim index e7ad5bd5a..1bd53edb7 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -328,14 +328,14 @@ proc toJson(x: NimNode): NimNode {.compiletime.} = result = newNimNode(nnkBracket) for i in 0 ..< x.len: result.add(toJson(x[i])) - result = newCall(bindSym"%", result) + result = newCall(bindSym("%", brOpen), result) of nnkTableConstr: # object if x.len == 0: return newCall(bindSym"newJObject") result = newNimNode(nnkTableConstr) for i in 0 ..< x.len: x[i].expectKind nnkExprColonExpr result.add newTree(nnkExprColonExpr, x[i][0], toJson(x[i][1])) - result = newCall(bindSym"%", result) + result = newCall(bindSym("%", brOpen), result) of nnkCurly: # empty object x.expectLen(0) result = newCall(bindSym"newJObject") @@ -343,9 +343,9 @@ proc toJson(x: NimNode): NimNode {.compiletime.} = result = newCall(bindSym"newJNull") of nnkPar: if x.len == 1: result = toJson(x[0]) - else: result = newCall(bindSym"%", x) + else: result = newCall(bindSym("%", brOpen), x) else: - result = newCall(bindSym"%", x) + result = newCall(bindSym("%", brOpen), x) macro `%*`*(x: untyped): untyped = ## Convert an expression to a JsonNode directly, without having to specify -- cgit 1.4.1-2-gfad0 id=10a4bb6f4e52256f66dcffce472e808354ddad88'>diff stats
path: root/docstyle.rst
blob: d789b1df91dd600ad076061c874ee787bf3335b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140