mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-21 12:17:53 -05:00
Reformat code with clang format
This commit is contained in:
@ -3,14 +3,14 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
template <typename ParserType>
|
||||
class AbstractScopeSequenceHolder
|
||||
template<typename ParserType> class AbstractScopeSequenceHolder
|
||||
{
|
||||
std::vector<std::unique_ptr<typename ParserType::sequence_t>>& m_all_sequences;
|
||||
std::vector<typename ParserType::sequence_t*>& m_scope_sequences;
|
||||
|
||||
protected:
|
||||
AbstractScopeSequenceHolder(std::vector<std::unique_ptr<typename ParserType::sequence_t>>& allSequences, std::vector<typename ParserType::sequence_t*>& scopeSequences)
|
||||
AbstractScopeSequenceHolder(std::vector<std::unique_ptr<typename ParserType::sequence_t>>& allSequences,
|
||||
std::vector<typename ParserType::sequence_t*>& scopeSequences)
|
||||
: m_all_sequences(allSequences),
|
||||
m_scope_sequences(scopeSequences)
|
||||
{
|
||||
|
@ -1,16 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
|
||||
#include "SequenceResult.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/Matcher/AbstractMatcher.h"
|
||||
#include "Parsing/Matcher/MatcherAnd.h"
|
||||
#include "Parsing/Matcher/MatcherLabel.h"
|
||||
#include "SequenceResult.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
template<typename TokenType, typename ParserState>
|
||||
class AbstractSequence : protected IMatcherForLabelSupplier<TokenType>
|
||||
#include <cassert>
|
||||
#include <unordered_map>
|
||||
|
||||
template<typename TokenType, typename ParserState> class AbstractSequence : protected IMatcherForLabelSupplier<TokenType>
|
||||
{
|
||||
// TokenType must inherit IParserValue
|
||||
static_assert(std::is_base_of<IParserValue, TokenType>::value);
|
||||
@ -19,7 +18,6 @@ public:
|
||||
typedef AbstractMatcher<TokenType> matcher_t;
|
||||
|
||||
private:
|
||||
|
||||
std::unique_ptr<matcher_t> m_entry;
|
||||
std::unordered_map<int, std::unique_ptr<matcher_t>> m_matchers;
|
||||
|
||||
@ -80,7 +78,7 @@ public:
|
||||
return false;
|
||||
|
||||
auto result = m_entry->Match(lexer, 0);
|
||||
|
||||
|
||||
if (result.m_matches)
|
||||
{
|
||||
SequenceResult<TokenType> sequenceResult(lexer, result);
|
||||
|
@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/Matcher/AbstractMatcher.h"
|
||||
#include "Parsing/Matcher/MatcherResult.h"
|
||||
#include "Parsing/ParsingException.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
template <typename TokenType>
|
||||
class SequenceResult
|
||||
#include <unordered_map>
|
||||
|
||||
template<typename TokenType> class SequenceResult
|
||||
{
|
||||
class Capture
|
||||
{
|
||||
@ -57,7 +56,7 @@ public:
|
||||
if (m_tag_offset < m_tags.size())
|
||||
{
|
||||
const auto result = m_tags[m_tag_offset];
|
||||
|
||||
|
||||
if (result == tag)
|
||||
m_tag_offset++;
|
||||
|
||||
@ -92,7 +91,7 @@ public:
|
||||
if (foundEntry == m_captures.end())
|
||||
throw ParsingException(TokenPos(), "Tried to access next capture even though no captures exists!");
|
||||
|
||||
if(foundEntry->second.m_offset >= foundEntry->second.m_tokens.size())
|
||||
if (foundEntry->second.m_offset >= foundEntry->second.m_tokens.size())
|
||||
throw ParsingException(TokenPos(), "Tried to access next capture even though none exists!");
|
||||
|
||||
return foundEntry->second.m_tokens[foundEntry->second.m_offset++];
|
||||
|
Reference in New Issue
Block a user