mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 08:41:52 +00:00
Reformat code with clang format
This commit is contained in:
@ -26,25 +26,23 @@ CommandsParser::CommandsParser(CommandsLexer* lexer, IDataRepository* targetRepo
|
||||
|
||||
const std::vector<CommandsParser::sequence_t*>& CommandsParser::GetTestsForState()
|
||||
{
|
||||
static std::vector<sequence_t*> tests({
|
||||
new SequenceAction(),
|
||||
new SequenceAllocAlign(),
|
||||
new SequenceArchitecture(),
|
||||
new SequenceArrayCount(),
|
||||
new SequenceArraySize(),
|
||||
new SequenceAsset(),
|
||||
new SequenceBlock(),
|
||||
new SequenceCondition(),
|
||||
new SequenceCount(),
|
||||
new SequenceGame(),
|
||||
new SequenceName(),
|
||||
new SequenceReorder(),
|
||||
new SequenceReusable(),
|
||||
new SequenceScriptString(),
|
||||
new SequenceSetBlock(),
|
||||
new SequenceString(),
|
||||
new SequenceUse()
|
||||
});
|
||||
static std::vector<sequence_t*> tests({new SequenceAction(),
|
||||
new SequenceAllocAlign(),
|
||||
new SequenceArchitecture(),
|
||||
new SequenceArrayCount(),
|
||||
new SequenceArraySize(),
|
||||
new SequenceAsset(),
|
||||
new SequenceBlock(),
|
||||
new SequenceCondition(),
|
||||
new SequenceCount(),
|
||||
new SequenceGame(),
|
||||
new SequenceName(),
|
||||
new SequenceReorder(),
|
||||
new SequenceReusable(),
|
||||
new SequenceScriptString(),
|
||||
new SequenceSetBlock(),
|
||||
new SequenceString(),
|
||||
new SequenceUse()});
|
||||
|
||||
return tests;
|
||||
}
|
||||
|
@ -54,8 +54,7 @@ bool CommandsParserState::GetNextTypenameSeparatorPos(const std::string& typeNam
|
||||
const auto typeNameValueSize = typeNameValue.size();
|
||||
for (auto currentHead = startPos + 1; currentHead < typeNameValueSize; currentHead++)
|
||||
{
|
||||
if (typeNameValue[currentHead] == ':'
|
||||
&& typeNameValue[currentHead - 1] == ':')
|
||||
if (typeNameValue[currentHead] == ':' && typeNameValue[currentHead - 1] == ':')
|
||||
{
|
||||
separatorPos = currentHead - 1;
|
||||
return true;
|
||||
@ -65,7 +64,10 @@ bool CommandsParserState::GetNextTypenameSeparatorPos(const std::string& typeNam
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CommandsParserState::ExtractMembersFromTypenameInternal(const std::string& typeNameValue, unsigned typeNameOffset, StructureInformation* type, std::vector<MemberInformation*>& members)
|
||||
bool CommandsParserState::ExtractMembersFromTypenameInternal(const std::string& typeNameValue,
|
||||
unsigned typeNameOffset,
|
||||
StructureInformation* type,
|
||||
std::vector<MemberInformation*>& members)
|
||||
{
|
||||
auto startOffset = typeNameOffset;
|
||||
while (GetNextTypenameSeparatorPos(typeNameValue, typeNameOffset, typeNameOffset))
|
||||
@ -89,13 +91,17 @@ bool CommandsParserState::ExtractMembersFromTypenameInternal(const std::string&
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandsParserState::GetMembersFromTypename(const std::string& typeNameValue, StructureInformation* baseType, std::vector<MemberInformation*>& members) const
|
||||
bool CommandsParserState::GetMembersFromTypename(const std::string& typeNameValue,
|
||||
StructureInformation* baseType,
|
||||
std::vector<MemberInformation*>& members) const
|
||||
{
|
||||
return m_in_use != nullptr && ExtractMembersFromTypenameInternal(typeNameValue, 0, m_in_use, members)
|
||||
|| ExtractMembersFromTypenameInternal(typeNameValue, 0, baseType, members);
|
||||
|| ExtractMembersFromTypenameInternal(typeNameValue, 0, baseType, members);
|
||||
}
|
||||
|
||||
bool CommandsParserState::GetTypenameAndMembersFromTypename(const std::string& typeNameValue, StructureInformation*& structure, std::vector<MemberInformation*>& members) const
|
||||
bool CommandsParserState::GetTypenameAndMembersFromTypename(const std::string& typeNameValue,
|
||||
StructureInformation*& structure,
|
||||
std::vector<MemberInformation*>& members) const
|
||||
{
|
||||
if (m_in_use != nullptr)
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "Persistence/IDataRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Persistence/IDataRepository.h"
|
||||
|
||||
class CommandsParserState
|
||||
{
|
||||
IDataRepository* m_repository;
|
||||
@ -13,7 +13,10 @@ class CommandsParserState
|
||||
|
||||
static MemberInformation* GetMemberWithName(const std::string& memberName, StructureInformation* type);
|
||||
static bool GetNextTypenameSeparatorPos(const std::string& typeNameValue, unsigned startPos, unsigned& separatorPos);
|
||||
static bool ExtractMembersFromTypenameInternal(const std::string& typeNameValue, unsigned typeNameOffset, StructureInformation* type, std::vector<MemberInformation*>& members);
|
||||
static bool ExtractMembersFromTypenameInternal(const std::string& typeNameValue,
|
||||
unsigned typeNameOffset,
|
||||
StructureInformation* type,
|
||||
std::vector<MemberInformation*>& members);
|
||||
|
||||
public:
|
||||
explicit CommandsParserState(IDataRepository* repository);
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Domain/Evaluation/OperationType.h"
|
||||
#include "Parsing/IParserValue.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/TokenPos.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
enum class CommandsParserValueType
|
||||
{
|
||||
@ -55,6 +55,7 @@ public:
|
||||
TokenPos m_pos;
|
||||
CommandsParserValueType m_type;
|
||||
size_t m_hash;
|
||||
|
||||
union ValueType
|
||||
{
|
||||
char char_value;
|
||||
@ -103,4 +104,4 @@ public:
|
||||
_NODISCARD size_t IdentifierHash() const;
|
||||
_NODISCARD std::string& TypeNameValue() const;
|
||||
_NODISCARD const OperationType* OpTypeValue() const;
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user