2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-01 22:47:26 +00:00

Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@@ -1,9 +1,9 @@
#pragma once
#include <vector>
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include <vector>
class SimpleMatcherAnyCharacterBesides final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -8,7 +8,6 @@ SimpleMatcherCharacter::SimpleMatcherCharacter(const char c)
MatcherResult<SimpleParserValue> SimpleMatcherCharacter::CanMatch(ILexer<SimpleParserValue>* lexer, const unsigned tokenOffset)
{
const auto& token = lexer->GetToken(tokenOffset);
return token.m_type == SimpleParserValueType::CHARACTER && token.CharacterValue() == m_char
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
return token.m_type == SimpleParserValueType::CHARACTER && token.CharacterValue() == m_char ? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
}

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
class SimpleMatcherCharacter final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -1,15 +1,15 @@
#pragma once
#include <string>
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcherFactory.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include <string>
class SimpleMatcherFactory : public AbstractMatcherFactory<SimpleParserValue>
{
public:
explicit SimpleMatcherFactory(const IMatcherForLabelSupplier<SimpleParserValue>* labelSupplier);
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Type(SimpleParserValueType type) const;
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> Keyword(std::string value) const;
_NODISCARD MatcherFactoryWrapper<SimpleParserValue> KeywordIgnoreCase(std::string value) const;

View File

@@ -11,6 +11,6 @@ MatcherResult<SimpleParserValue> SimpleMatcherKeyword::CanMatch(ILexer<SimplePar
{
const auto& token = lexer->GetToken(tokenOffset);
return token.m_type == SimpleParserValueType::IDENTIFIER && token.IdentifierHash() == m_hash && token.IdentifierValue() == m_value
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
}

View File

@@ -1,9 +1,9 @@
#pragma once
#include <string>
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include <string>
class SimpleMatcherKeyword final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -17,10 +17,14 @@ MatcherResult<SimpleParserValue> SimpleMatcherKeywordIgnoreCase::CanMatch(ILexer
return MatcherResult<SimpleParserValue>::NoMatch();
const auto& identifierValue = token.IdentifierValue();
const auto isEqual = std::equal(identifierValue.begin(), identifierValue.end(), m_value.begin(), m_value.end(), [](const char a, const char b)
{
return tolower(a) == b;
});
const auto isEqual = std::equal(identifierValue.begin(),
identifierValue.end(),
m_value.begin(),
m_value.end(),
[](const char a, const char b)
{
return tolower(a) == b;
});
if (isEqual)
return MatcherResult<SimpleParserValue>::Match(1);

View File

@@ -1,9 +1,9 @@
#pragma once
#include <string>
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include <string>
class SimpleMatcherKeywordIgnoreCase final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -9,6 +9,6 @@ MatcherResult<SimpleParserValue> SimpleMatcherKeywordPrefix::CanMatch(ILexer<Sim
{
const auto& token = lexer->GetToken(tokenOffset);
return token.m_type == SimpleParserValueType::IDENTIFIER && token.IdentifierValue().compare(0, m_value.size(), m_value) == 0
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
}

View File

@@ -1,9 +1,9 @@
#pragma once
#include <string>
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include <string>
class SimpleMatcherKeywordPrefix final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
class SimpleMatcherMultiCharacter final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -7,7 +7,5 @@ SimpleMatcherValueType::SimpleMatcherValueType(const SimpleParserValueType type)
MatcherResult<SimpleParserValue> SimpleMatcherValueType::CanMatch(ILexer<SimpleParserValue>* lexer, const unsigned tokenOffset)
{
return lexer->GetToken(tokenOffset).m_type == m_type
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
return lexer->GetToken(tokenOffset).m_type == m_type ? MatcherResult<SimpleParserValue>::Match(1) : MatcherResult<SimpleParserValue>::NoMatch();
}

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
class SimpleMatcherValueType final : public AbstractMatcher<SimpleParserValue>
{

View File

@@ -9,7 +9,6 @@ SimpleMatcherValueTypeAndHasSignPrefix::SimpleMatcherValueTypeAndHasSignPrefix(c
MatcherResult<SimpleParserValue> SimpleMatcherValueTypeAndHasSignPrefix::CanMatch(ILexer<SimpleParserValue>* lexer, const unsigned tokenOffset)
{
const auto& token = lexer->GetToken(tokenOffset);
return token.m_type == m_type && token.m_has_sign_prefix == m_has_sign_prefix
? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
return token.m_type == m_type && token.m_has_sign_prefix == m_has_sign_prefix ? MatcherResult<SimpleParserValue>::Match(1)
: MatcherResult<SimpleParserValue>::NoMatch();
}

View File

@@ -1,7 +1,7 @@
#pragma once
#include "Parsing/Simple/SimpleParserValue.h"
#include "Parsing/Matcher/AbstractMatcher.h"
#include "Parsing/Simple/SimpleParserValue.h"
class SimpleMatcherValueTypeAndHasSignPrefix final : public AbstractMatcher<SimpleParserValue>
{