Skip to content

Commit

Permalink
fix: try using fully qualified name for return enum in astnode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdovzhanyn committed Sep 27, 2024
1 parent 9be7b42 commit 1b9d07c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compiler/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace Theta {
return generateAssignment(dynamic_pointer_cast<AssignmentNode>(node), module);
} else if (node->getNodeType() == ASTNode::BLOCK) {
return generateBlock(dynamic_pointer_cast<ASTNodeList>(node), module);
} else if (node->getNodeType() == ASTNode::RETURN) {
} else if (node->getNodeType() == Theta::ASTNode::RETURN) {
return generateReturn(dynamic_pointer_cast<ReturnNode>(node), module);
} else if (node->getNodeType() == ASTNode::FUNCTION_DECLARATION) {
// The only time we should get here is if we have a function defined inside a function,
Expand Down
7 changes: 4 additions & 3 deletions src/compiler/StandardLibrary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ namespace Theta {
BinaryenLocalGet(module, 2, BinaryenTypeInt64())
};

BinaryenType fnTypes[2] = { BinaryenTypeInt64(), BinaryenTypeInt64() };
BinaryenType paramTypes[2] = { BinaryenTypeInt64(), BinaryenTypeInt64() };
BinaryenType varTypes[1] = { BinaryenTypeInt64() };

BinaryenFunctionRef powFn = BinaryenAddFunction(
module,
"Theta.Math.pow",
BinaryenTypeCreate(fnTypes, 2),
BinaryenTypeCreate(paramTypes, 2),
BinaryenTypeInt64(),
(BinaryenType[]){ BinaryenTypeInt64() },
varTypes,
1,
BinaryenBlock(
module,
Expand Down

0 comments on commit 1b9d07c

Please sign in to comment.