Skip to content

Commit

Permalink
API extension (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored Aug 30, 2024
1 parent 4b8e6f2 commit 7dba80e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/nifcursors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ proc add*(result: var TokenBuf; c: Cursor) =
elif item.kind == ParLe: inc nested
inc c

proc addUnstructured*(result: var TokenBuf; c: Cursor) =
var c = c
while c.rem > 0:
result.add c.load
inc c

proc add*(result: var TokenBuf; s: var Stream) =
let c = next(s)
assert c.kind != ParRi, "cursor at end?"
Expand Down

0 comments on commit 7dba80e

Please sign in to comment.