Fix NimScriptApi builtins. Implement before/after hooks for NimS.

This commit is contained in:
Dominik Picheta 2015-12-30 18:14:32 +00:00
commit 5d55a5f7a2
5 changed files with 95 additions and 19 deletions

View file

@ -24,6 +24,17 @@ proc requires*(deps: varargs[string]) =
## package.
for d in deps: requiresData.add(d)
template before*(action: untyped, body: untyped): untyped =
## Defines a block of code which is evaluated before ``action`` is executed.
proc `action Before`*(): bool =
result = false
body
template after*(action: untyped, body: untyped): untyped =
## Defines a block of code which is evaluated after ``action`` is executed.
proc `action After`*(): bool =
body
template builtin = discard
proc getPkgDir*(): string =