Add support for enum values.
This commit is contained in:
parent
af755a8a8d
commit
cd52c9860d
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user