File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -58,25 +58,16 @@ proc getSize(t: char): int {.noSideEffect, inline.} =
5858 of 'q' , 'Q' , 'd' : 8
5959 else : 0
6060
61- proc newStructChar * (c: char ): StructNode =
62- result .kind = StructChar
63- result .ch = c
61+ proc newStructChar * (c: char ): StructNode = StructNode (kind: StructChar , ch: c)
6462
65- proc newStructBool * (b: bool ): StructNode =
66- result .kind = StructBool
67- result .bval = b
63+ proc newStructBool * (b: bool ): StructNode = StructNode (kind: StructBool , bval: b)
6864
69- proc newStructInt * [T: uint | int | int16 | uint16 | int32 | uint32 | int64 | uint64 | BiggestInt ](i: T): StructNode =
70- result .kind = StructInt
71- result .num = i.BiggestInt
65+ proc newStructInt * [T: uint | int | int16 | uint16 | int32 | uint32 | int64 | uint64 | BiggestInt ](i: T): StructNode =
66+ result = StructNode (kind: StructInt , num: i.BiggestInt )
7267
73- proc newStructFloat * (d: BiggestFloat ): StructNode =
74- result .kind = StructFloat
75- result .fval = d
68+ proc newStructFloat * (d: BiggestFloat ): StructNode = StructNode (kind: StructFloat , fval: d)
7669
77- proc newStructString * (s: string ): StructNode =
78- result .kind = StructString
79- result .str = s
70+ proc newStructString * (s: string ): StructNode = StructNode (kind: StructString , str: s)
8071
8172proc newStructContext (): StructContext =
8273 result .byteOrder = system.cpuEndian
You can’t perform that action at this time.
0 commit comments