feat: migrate from OpView to DoubleLinkedList<Op*> + multiple
funciton arguments
This commit is contained in:
@@ -24,7 +24,7 @@ class Node
|
||||
public:
|
||||
virtual NodeType GetType() const = 0;
|
||||
virtual ~Node() {}
|
||||
};
|
||||
};
|
||||
|
||||
class ExpressionNode : public Node
|
||||
{
|
||||
@@ -144,20 +144,17 @@ class FnCallNode : public Node
|
||||
{
|
||||
public:
|
||||
// TODO: support multiple arguments
|
||||
FnCallNode(const StringView& name, Node* arg)
|
||||
: m_name(name), m_arg(arg) {}
|
||||
~FnCallNode() override {
|
||||
delete m_arg;
|
||||
}
|
||||
FnCallNode(const StringView& name, View<Node*>&& arg)
|
||||
: m_name(name), m_args(arg) {}
|
||||
~FnCallNode() override = default;
|
||||
|
||||
NODE_TYPE(FnCall)
|
||||
public:
|
||||
const StringView& name() const { return m_name; }
|
||||
// TODO: support multiple args
|
||||
const Node* arg() const { return m_arg; }
|
||||
const View<Node*>& args() const { return m_args; }
|
||||
private:
|
||||
StringView m_name;
|
||||
Node* m_arg;
|
||||
View<Node*> m_args;
|
||||
};
|
||||
|
||||
class VariableNode : public Node
|
||||
@@ -214,4 +211,4 @@ public:
|
||||
private:
|
||||
std::vector<FnDeclNode*> m_funcs;
|
||||
std::vector<ExternNode*> m_externs;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user