diff options
author | Billingsly Wetherfordshire <phowl.mouth@gmail.com> | 2013-04-25 17:26:50 -0500 |
---|---|---|
committer | Billingsly Wetherfordshire <phowl.mouth@gmail.com> | 2013-04-25 17:26:50 -0500 |
commit | 0169d671b3727c239d3808877b94b6e0ebc505d4 (patch) | |
tree | 994bb129caacdb122dad45abc25154fe12dca8a2 /lib/core | |
parent | 8e12d1fb573e1841a84b67289853b054aeafe5ac (diff) | |
download | Nim-0169d671b3727c239d3808877b94b6e0ebc505d4.tar.gz |
Update macros.nim
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/macros.nim | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 4598fa9ea..949719316 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -130,12 +130,14 @@ proc `==`*(a, b: PNimrodNode): bool {.magic: "EqNimrodNode", noSideEffect.} proc len*(n: PNimrodNode): int {.magic: "NLen".} ## returns the number of children of `n`. -proc add*(father, child: PNimrodNode) {.magic: "NAdd".} - ## adds the `child` to the `father` node - -proc add*(father: PNimrodNode, children: varargs[PNimrodNode]) {. - magic: "NAddMultiple".} - ## adds each child of `children` to the `father` node +proc add*(father, child: PNimrodNode): PNimrodNode {.magic: "NAdd", discardable.} + ## Adds the `child` to the `father` node. Returns the + ## father node so that calls can be nested. + +proc add*(father: PNimrodNode, children: varargs[PNimrodNode]): PNimrodNode {. + magic: "NAddMultiple", discardable.} + ## Adds each child of `children` to the `father` node. + ## Returns the `father` node so that calls can be nested. proc del*(father: PNimrodNode, idx = 0, n = 1) {.magic: "NDel".} ## deletes `n` children of `father` starting at index `idx`. |