Skip to content

Commit

Permalink
Merge pull request #6 from ehmry/gcsafe
Browse files Browse the repository at this point in the history
Avoid declaring procs without bodies
  • Loading branch information
gokr committed Aug 14, 2019
2 parents 0e5c494 + fe9dfad commit a5928fe
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spryvm/spryvm.nim
Expand Up @@ -611,20 +611,18 @@ proc currentKeyword(self: Parser): KeyWord =
else:
return nil

proc closeKeyword(self: Parser)
proc pop(self: Parser): Node =
if self.currentKeyword().notNil:
self.closeKeyword()
self.stack.pop()

proc addNode(self: Parser)
proc closeKeyword(self: Parser) =
let keyword = self.currentKeyword()
discard self.stack.pop()
let nodes = keyword.produceNodes()
SeqComposite(self.top).removeLast()
SeqComposite(self.top).add(nodes)

proc pop(self: Parser): Node =
if self.currentKeyword().notNil:
self.closeKeyword()
self.stack.pop()

proc doAddNode(self: Parser, node: Node) =
# If we are collecting a keyword, we get nil until its ready
let keyword = self.currentKeyword()
Expand Down

0 comments on commit a5928fe

Please sign in to comment.