Skip to content

Instantly share code, notes, and snippets.

Created January 23, 2018 16:23
Show Gist options
  • Save anonymous/1662326c7d52f5ca0f3d9aade792d73c to your computer and use it in GitHub Desktop.
Save anonymous/1662326c7d52f5ca0f3d9aade792d73c to your computer and use it in GitHub Desktop.
macro loadTerms(): untyped =
result = newNimNode(nnkStmtList)
result.add(quote do:
var KEYMAPSTRING_TABLE = initTable[string, string]()
)
for term in walkFiles("term/*.txt"):
result.add(quote do:
KEYMAPSTRING_TABLE[term.splitFile().name] = staticRead(term)
)
loadTerms()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment