mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-22 06:16:01 +00:00
Reformat code with clang format
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "Parsing/ILexer.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Parsing/Matcher/MatcherResult.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Parsing/ILexer.h"
|
||||
#include "Parsing/Matcher/MatcherResult.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class AbstractMatcher
|
||||
template<typename TokenType> class AbstractMatcher
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -83,7 +82,7 @@ public:
|
||||
result.m_matched_tokens.clear();
|
||||
result.m_matched_tokens.emplace_back(result.m_fabricated_tokens.size() - 1, true);
|
||||
}
|
||||
else if(result.m_matched_tokens.empty())
|
||||
else if (result.m_matched_tokens.empty())
|
||||
{
|
||||
for (auto i = 0u; i < result.m_consumed_token_count; i++)
|
||||
result.m_matched_tokens.emplace_back(tokenOffset + i, false);
|
||||
|
@@ -1,20 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "MatcherAnd.h"
|
||||
#include "MatcherFalse.h"
|
||||
#include "MatcherLabel.h"
|
||||
#include "MatcherLoop.h"
|
||||
#include "MatcherOptional.h"
|
||||
#include "MatcherOr.h"
|
||||
#include "MatcherTrue.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "AbstractMatcher.h"
|
||||
#include "MatcherAnd.h"
|
||||
#include "MatcherLabel.h"
|
||||
#include "MatcherLoop.h"
|
||||
#include "MatcherFalse.h"
|
||||
#include "MatcherTrue.h"
|
||||
#include "MatcherOptional.h"
|
||||
#include "MatcherOr.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherFactoryWrapper
|
||||
template<typename TokenType> class MatcherFactoryWrapper
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -71,8 +70,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <typename TokenType>
|
||||
class AbstractMatcherFactory
|
||||
template<typename TokenType> class AbstractMatcherFactory
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
|
@@ -1,13 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherAnd final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherAnd final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -25,10 +24,10 @@ protected:
|
||||
|
||||
if (!result.m_matches)
|
||||
return MatcherResult<TokenType>::NoMatch();
|
||||
|
||||
|
||||
matchResult.Absorb(std::move(result));
|
||||
}
|
||||
|
||||
|
||||
return matchResult;
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherFalse final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherFalse final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -18,6 +17,5 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
MatcherFalse()
|
||||
= default;
|
||||
MatcherFalse() = default;
|
||||
};
|
||||
|
@@ -1,13 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class IMatcherForLabelSupplier
|
||||
template<typename TokenType> class IMatcherForLabelSupplier
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -23,8 +22,7 @@ public:
|
||||
_NODISCARD virtual AbstractMatcher<TokenType>* GetMatcherForLabel(int label) const = 0;
|
||||
};
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherLabel final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherLabel final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
|
@@ -1,12 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherLoop final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherLoop final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -19,11 +18,11 @@ protected:
|
||||
auto matchResult = MatcherResult<TokenType>::Match(0);
|
||||
auto loopedAtLeastOnce = false;
|
||||
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
auto result = m_matcher->Match(lexer, tokenOffset + matchResult.m_consumed_token_count);
|
||||
|
||||
if(!result.m_matches)
|
||||
if (!result.m_matches)
|
||||
{
|
||||
if (loopedAtLeastOnce)
|
||||
return matchResult;
|
||||
|
@@ -1,12 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherOptional final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherOptional final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
|
@@ -1,13 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherOr final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherOr final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherResult
|
||||
template<typename TokenType> class MatcherResult
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
|
@@ -1,12 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractMatcher.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "AbstractMatcher.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class MatcherTrue final : public AbstractMatcher<TokenType>
|
||||
template<typename TokenType> class MatcherTrue final : public AbstractMatcher<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@@ -18,6 +17,5 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
MatcherTrue()
|
||||
= default;
|
||||
MatcherTrue() = default;
|
||||
};
|
||||
|
Reference in New Issue
Block a user