Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Dec 30, 2023
1 parent 08fcd23 commit bc77836
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ast/lang/lang_builder.nim
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,16 @@ proc updateLanguageFromModel*(language: Language, model: Model, updateBuilder: b
let resultLen = module.getInt32(arrPtr)
let resultPtr = module.getInt32(arrPtr + 8).WasmPtr

result = newSeqOfCap[AstNode](resultLen)
var res = newSeqOfCap[AstNode](resultLen)
for i in 0..<resultLen:
let nodeIndex = module.getInt32(resultPtr + i * 4)
if gNodeRegistry.getNode(nodeIndex).getSome(node):
result.add node
res.add node
else:
log lvlError, fmt"Invalid node index returned from scope function: {nodeIndex}"

return res

scopeComputers[class] = computeScopeImplWrapper

language.update(classes, typeComputers, valueComputers, scopeComputers, validationComputers)
Expand Down

0 comments on commit bc77836

Please sign in to comment.