forked from solstice/solstice
Function calling fix
This commit is contained in:
@@ -655,7 +655,7 @@ namespace Solstice {
|
||||
if (isTemp(children[1].outputId)) codeBlock.toBeDropped.push_back(children[1].outputId);
|
||||
code.push_back(codeBlock);
|
||||
// Make sure we know what the variable type is
|
||||
variables[children[0].outputId] = children[1].data.getTypeString();
|
||||
variables[children[0].outputId] = checkNodeReturnType(children[1]);
|
||||
break;
|
||||
}
|
||||
case SolNodeType::FunctionCall: {
|
||||
@@ -1268,7 +1268,7 @@ namespace Solstice {
|
||||
}
|
||||
case SolNodeType::BracketStart: {
|
||||
// function call
|
||||
if (rootNode.children.back().nodeType == SolNodeType::Identifier) {
|
||||
if (!rootNode.children.empty() && rootNode.children.back().nodeType == SolNodeType::Identifier) {
|
||||
SolNode fnCallNode(SolNodeType::FunctionCall);
|
||||
fnCallNode.line = tokenObj.line;
|
||||
fnCallNode.lineContent = tokenObj.lineContent;
|
||||
@@ -1317,8 +1317,9 @@ namespace Solstice {
|
||||
tokens.push_back(tokenopt.value());
|
||||
}
|
||||
auto node = Parser(tokens).parse();
|
||||
node.nodeType = SolNodeType::Expression;
|
||||
rootNode.addNode(node);
|
||||
if (!node.children.empty()) {
|
||||
rootNode.addNode(node.children.back());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user