mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 18:09:03 +00:00
Im vonfused
This commit is contained in:
17
Parser/src/AST-Loggers.cpp
Normal file
17
Parser/src/AST-Loggers.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <AST.h>
|
||||
|
||||
namespace LX
|
||||
{
|
||||
std::string ToString(std::unique_ptr<AST::Node>& node)
|
||||
{
|
||||
if (node == nullptr) { return "NULL Node"; }
|
||||
|
||||
switch (node->m_Type)
|
||||
{
|
||||
case AST::Node::IDENTIFIER: return "IDENTIFIER";
|
||||
case AST::Node::OPERATION: return "OPERATION";
|
||||
case AST::Node::RETURN_STATEMENT: return "return";
|
||||
case AST::Node::NUMBER_LITERAL: return "number";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user