summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndrey Sobolev <andrey.sobolev@xored.com>2015-09-07 21:19:52 +0600
committerAndrey Sobolev <andrey.sobolev@xored.com>2015-09-07 21:19:52 +0600
commita5344340569b0b54351f902a79b2d1f8f2397dc6 (patch)
treee6518433644a3c46dcb58af52b097d681b8caada /lib
parentf405876b35b4ff4f95dcd289bd51df196aab5569 (diff)
downloadNim-a5344340569b0b54351f902a79b2d1f8f2397dc6.tar.gz
allow to delete xmlnode childs
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/xmltree.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim
index 435a7a549..1c8573986 100644
--- a/lib/pure/xmltree.nim
+++ b/lib/pure/xmltree.nim
@@ -121,6 +121,11 @@ proc `[]`* (n: XmlNode, i: int): XmlNode {.inline.} =
   assert n.k == xnElement
   result = n.s[i]
 
+proc delete*(n: XmlNode, i: Natural) {.noSideEffect.} =
+  ## delete the `i`'th child of `n`.
+  assert n.k == xnElement
+  n.s.delete(i)
+
 proc mget* (n: var XmlNode, i: int): var XmlNode {.inline.} =
   ## returns the `i`'th child of `n` so that it can be modified
   assert n.k == xnElement