Add support for enum values.
This commit is contained in:
1 parent
af755a8a8d
commit
cd52c9860d
1 file changed
+4
@@ -200,6 +200,10 @@ proc createParseStmt*(t, value: NimNode): NimNode =
|
||||
elif t.typeKind == ntyBool:
|
||||
result = quote do: "true".startsWith(`value`.toLower)
|
||||
|
||||
elif t.typeKind == ntyEnum:
|
||||
let innerType = t.getTypeInst
|
||||
result = quote do: parseEnum[`innerType`](`value`)
|
||||
|
||||
else:
|
||||
error "Unknown value type: " & $t.typeKind
|
||||
|
||||
|
||||
Reference in new issue
Block a user