mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
Improved syntax for functions
Added logging system for AST nodes as well.
This commit is contained in:
@@ -16,9 +16,6 @@ namespace LX
|
||||
llvm::Module module;
|
||||
llvm::IRBuilder<> builder;
|
||||
};
|
||||
|
||||
// Function to turn a AST node into string //
|
||||
std::string ToString(std::unique_ptr<AST::Node>& node);
|
||||
}
|
||||
|
||||
namespace LX::AST
|
||||
@@ -33,6 +30,9 @@ namespace LX::AST
|
||||
// Function for generating LLVN IR (Intermediate representation) //
|
||||
llvm::Value* GenIR(InfoLLVM& LLVM) override;
|
||||
|
||||
// Function to log the node to a file //
|
||||
void Log(std::ofstream* log, unsigned depth) override;
|
||||
|
||||
private:
|
||||
// The number it stores //
|
||||
// Yes the number is stored as a string, It's horrible I know //
|
||||
@@ -49,6 +49,9 @@ namespace LX::AST
|
||||
// Function for generating LLVN IR (Intermediate representation) //
|
||||
llvm::Value* GenIR(InfoLLVM& LLVM) override;
|
||||
|
||||
// Function to log the node to a file //
|
||||
void Log(std::ofstream* log, unsigned depth) override;
|
||||
|
||||
private:
|
||||
// The sides of the operation //
|
||||
// Unary operations are handled by a different class //
|
||||
@@ -68,6 +71,9 @@ namespace LX::AST
|
||||
// Function for generating LLVN IR (Intermediate representation) //
|
||||
llvm::Value* GenIR(InfoLLVM& LLVM) override;
|
||||
|
||||
// Function to log the node to a file //
|
||||
void Log(std::ofstream* log, unsigned depth) override;
|
||||
|
||||
private:
|
||||
// What it is returning (can be null) //
|
||||
std::unique_ptr<Node> m_Val;
|
||||
|
||||
Reference in New Issue
Block a user