From de2a207fcb16bfbbe5b9c7b4dbe3b0b1f86b7751 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 28 Mar 2023 20:17:03 +0200 Subject: [PATCH] AST: Reorder classes --- src/ast.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/ast.h b/src/ast.h index 5d6bd75..6cc2533 100644 --- a/src/ast.h +++ b/src/ast.h @@ -161,22 +161,6 @@ private: // ----------------------------------------- -// Symbols -class Symbol final : public ASTNode { -public: - explicit Symbol(const std::string& symbol); - virtual ~Symbol() = default; - - virtual bool isSymbol() const override { return true; } - - const std::string& symbol() const { return m_symbol; } - -private: - std::string m_symbol; -}; - -// ----------------------------------------- - // true, false, nil class Value final : public ASTNode { public: @@ -199,6 +183,22 @@ private: // ----------------------------------------- +// Symbols +class Symbol final : public ASTNode { +public: + explicit Symbol(const std::string& symbol); + virtual ~Symbol() = default; + + virtual bool isSymbol() const override { return true; } + + const std::string& symbol() const { return m_symbol; } + +private: + std::string m_symbol; +}; + +// ----------------------------------------- + using Lambda = std::function)>; class Function final : public ASTNode { @@ -247,10 +247,10 @@ template<> inline bool ASTNode::fastIs() const { return isNumber(); } template<> -inline bool ASTNode::fastIs() const { return isSymbol(); } +inline bool ASTNode::fastIs() const { return isValue(); } template<> -inline bool ASTNode::fastIs() const { return isValue(); } +inline bool ASTNode::fastIs() const { return isSymbol(); } template<> inline bool ASTNode::fastIs() const { return isFunction(); }