Remove style insensitive config handling.

pull/35/head
SolitudeSF 5 years ago
parent 59ea7ab324
commit 9c1bc4f08f
No known key found for this signature in database
GPG Key ID: 789B06817C385387

@ -15,15 +15,8 @@ const defaultConfig* = Config(
fps: 60
)
func normIdent(s: string): string =
if s.len > 0:
result.add s[0]
for i in 1..s.high:
if s[i] != '_':
result.add s[i].toLowerAscii
macro parseObject(obj: typed, key, val: string) =
result = newNimNode(nnkCaseStmt).add(newCall("normIdent", key))
result = newNimNode(nnkCaseStmt).add(key)
for c in obj.getType[2]:
let a = case c.getType.typeKind
of ntyFloat:
@ -36,7 +29,7 @@ macro parseObject(obj: typed, key, val: string) =
error "Unsupported type: " & c.getType.`$`
val
result.add newNimNode(nnkOfBranch).add(
newLit normIdent $c,
newLit $c,
newStmtList(quote do: `obj`.`c` = `a`)
)
result.add newNimNode(nnkElse).add(quote do:

Loading…
Cancel
Save