Updated function signatures
This commit is contained in:
@@ -12,15 +12,33 @@ namespace LXC::Parser
|
||||
struct FunctionAST
|
||||
{
|
||||
FunctionAST() :
|
||||
name{}, contents{}
|
||||
name{}, contents{}, funcParams{}
|
||||
{}
|
||||
|
||||
FunctionAST(FunctionAST&& other) noexcept :
|
||||
name{}, contents{}
|
||||
name(std::move(other.name)), contents(std::move(other.contents)), funcParams(std::move(other.funcParams))
|
||||
{}
|
||||
|
||||
std::string name;
|
||||
std::vector<std::pair<std::string, std::string>> funcParams;
|
||||
|
||||
AST::SyntaxBranch contents;
|
||||
|
||||
std::string LogStr() const
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << name << " (";
|
||||
|
||||
for (size_t i = 0; i < funcParams.size(); i++)
|
||||
{
|
||||
os << funcParams[i].first << ' ' << funcParams[i].second;
|
||||
if (i != funcParams.size() - 1)
|
||||
os << ", ";
|
||||
}
|
||||
|
||||
os << ")";
|
||||
return os.str();
|
||||
}
|
||||
};
|
||||
|
||||
Util::ReturnVal<std::vector<FunctionAST>, ParserError> TurnTokensIntoAST(const Lexer::LexerOutput& input);
|
||||
|
||||
Reference in New Issue
Block a user