Skip to content

Commit

Permalink
Avoid declaring procs without bodies
Browse files Browse the repository at this point in the history
The complier assumes that procedures declared without bodies are not
gcsafe, which implies that procedures calling those procedures are not
gcsafe either.
  • Loading branch information
ehmry committed Jun 5, 2019
1 parent cf3de40 commit 06442b4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spryvm/spryvm.nim
Expand Up @@ -605,20 +605,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 06442b4

Please sign in to comment.