Moved Common to external git repo
Also changed namespace from LXC to PashaBibko::LXC
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
#include <LXC.h>
|
||||
#include <Util.h>
|
||||
|
||||
#include <Parser.h>
|
||||
|
||||
namespace LXC::Internal
|
||||
namespace PashaBibko::LXC::Internal
|
||||
{
|
||||
template<typename NodeType, typename... Args>
|
||||
requires std::is_base_of_v<AST::Node, NodeType> && std::is_constructible_v<NodeType, Args...>
|
||||
static const inline Util::ReturnVal<AST::NodePtr, Parser::ParserError> CreateNode(Args&&... args)
|
||||
{
|
||||
return Util::ReturnVal<AST::NodePtr, Parser::ParserError>(std::make_unique<NodeType>(std::forward<Args>(args)...));
|
||||
return AST::NodePtr(std::make_unique<NodeType>(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename NodeType, typename... Args>
|
||||
requires std::is_base_of_v<AST::NodeValue, NodeType> && std::is_constructible_v<NodeType, Args...>
|
||||
static const inline Util::ReturnVal<AST::NodeValuePtr, Parser::ParserError> CreateNodeV(Args&&... args)
|
||||
{
|
||||
return Util::ReturnVal<AST::NodeValuePtr, Parser::ParserError>(std::make_unique<NodeType>(std::forward<Args>(args)...));
|
||||
return AST::NodeValuePtr(std::make_unique<NodeType>(std::forward<Args>(args)...));
|
||||
}
|
||||
}
|
||||
|
||||
namespace LXC::Parser
|
||||
namespace PashaBibko::LXC::Parser
|
||||
{
|
||||
class ParserContext final
|
||||
{
|
||||
@@ -130,7 +130,7 @@ namespace LXC::Parser
|
||||
ctx.Advance();
|
||||
|
||||
// Adds the current argument to the ValueList //
|
||||
arguments.push_back(ParsePrimary(ctx));
|
||||
arguments.push_back(std::move(ParsePrimary(ctx).Result()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user