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.} =
58
58
of 'q' , 'Q' , 'd' : 8
59
59
else : 0
60
60
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)
64
62
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)
68
64
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)
72
67
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)
76
69
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)
80
71
81
72
proc newStructContext(): StructContext =
82
73
result .byteOrder = system.cpuEndian
You can’t perform that action at this time.
0 commit comments