Massive reformating and cleanup

This commit is contained in:
2024-12-06 21:07:54 +01:00
parent 79390b94b7
commit d2cbdc2910
33 changed files with 1030 additions and 1100 deletions

View File

@ -4,23 +4,21 @@
#include "ast/ast_base.hpp"
#include "util/text.hpp"
namespace fsh {
template<Lexer::TokenType T>
class TokenNode : public AstNode {
public:
using shared = std::shared_ptr<TokenNode>;
Lexer::TokenType gtoken_type() {return T;}
std::string& gvalue() {return value;};
static std::shared_ptr<TokenNode> build(std::list<Token>::iterator& it);
template <Lexer::TokenType T>
class TokenNode : public AstNode {
public:
using shared = std::shared_ptr<TokenNode>;
Lexer::TokenType gtoken_type() { return T; }
std::string& gvalue() { return value; };
static std::shared_ptr<TokenNode> build(std::list<Token>::iterator& it);
protected:
TokenNode(std::string value)
: AstNode(NodeType::TOKEN, util::tokens[T]), value(value) {}
protected:
TokenNode(std::string value) : AstNode(NodeType::TOKEN, util::tokens[T]), value(value) {}
private:
std::string value;
};
private:
std::string value;
};
}