Refactored arguments

This commit is contained in:
2024-12-06 19:17:37 +01:00
parent 8fa3c3d35a
commit 79390b94b7
13 changed files with 301 additions and 245 deletions

View File

@ -0,0 +1,22 @@
#pragma once
#include <memory>
#include "ast/ast_component.hpp"
namespace fsh{
class _Argument {
public:
virtual void svalue(const std::string& can, const Lexer::TokenType& type = Lexer::TokenType::FLAG) {}
virtual void svalue(std::shared_ptr<CommandArgumentNode> can) {
svalue(can->gvalue(), can->gtoken_type());
}
template<typename T>
static std::shared_ptr<_Argument> create() {return std::make_shared<T>();}
protected:
_Argument(){}
};
}