Fix NimScriptApi builtins. Implement before/after hooks for NimS.
This commit is contained in:
parent
c4639fc145
commit
5d55a5f7a2
5 changed files with 95 additions and 19 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue