File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 244244 of nkInt: intVal: int
245245 of nkFloat: floatVal: float
246246
247- proc renameHook * (v: var RefNode | ValueNode , fieldName: var string ) =
247+ proc renameHook * (v: var RefNode | ValueNode , fieldName: var string ) =
248248 # rename``type`` field name to ``kind``
249249 if fieldName == " type" :
250250 fieldName = " kind"
@@ -267,3 +267,20 @@ block:
267267 doAssert a.kind == nkFloat
268268 doAssert b.kind == nkFloat
269269 doAssert c.kind == nkFloat
270+
271+
272+ # test https://forum.nim-lang.org/t/7619
273+
274+ import jsony
275+
276+ type
277+ FooBar = object
278+ `Foo Bar`: string
279+
280+ const jsonString = " {\" Foo Bar\" : \" Hello World\" }"
281+
282+ proc renameHook * (v: var FooBar , fieldName: var string ) =
283+ if fieldName == " Foo Bar" :
284+ fieldName = " FooBar"
285+
286+ echo jsonString.fromJson (FooBar )
You can’t perform that action at this time.
0 commit comments