Added ParsePrimary (base of call stack)

This commit is contained in:
Pasha Bibko
2025-08-04 15:46:43 +01:00
parent 7e95b7157e
commit 820d374fa0
3 changed files with 63 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ namespace LXC::AST
class IntLiteral final : public NodeValue
{
public:
IntLiteral(std::string& value);
IntLiteral(const std::string_view& value);
private:
// Yes numbers are stored as strings //
@@ -73,7 +73,7 @@ namespace LXC::AST
class VarAccess final : public NodeValue
{
public:
VarAccess(Identifier& name);
VarAccess(const Identifier& name);
private:
// The name of the variable //

View File

@@ -8,8 +8,8 @@ namespace LXC::AST
: NodeValue(NodeType::FunctionCall), m_FuncName(std::move(functionName)), m_Arguments(std::move(arguments))
{}
IntLiteral::IntLiteral(std::string& value)
: NodeValue(NodeType::IntLiteral), m_NumberValue(std::move(value))
IntLiteral::IntLiteral(const std::string_view& value)
: NodeValue(NodeType::IntLiteral), m_NumberValue(value)
{}
Operation::Operation(NodeValuePtr& left, Lexer::Token::TokenType operand, NodeValuePtr& right)
@@ -28,8 +28,8 @@ namespace LXC::AST
: Node(NodeType::Var_Assign), m_Value(std::move(value))
{}
VarAccess::VarAccess(Identifier& name)
: NodeValue(NodeType::Var_Access), m_Name(std::move(m_Name))
VarAccess::VarAccess(const Identifier& name)
: NodeValue(NodeType::Var_Access), m_Name(name)
{}
IfBranch::IfBranch(NodeValuePtr& condition, SyntaxBranch& body)