mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
parse variables
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Parsing/Header/Sequence/SequenceNamespace.h"
|
||||
#include "Parsing/Mock/MockLexer.h"
|
||||
#include "Parsing/Mock/MockPackValueSupplier.h"
|
||||
|
||||
namespace test::parsing::header::sequence::sequence_namespace
|
||||
{
|
||||
@ -15,8 +16,9 @@ namespace test::parsing::header::sequence::sequence_namespace
|
||||
HeaderParserValue::Character(pos, '{')
|
||||
}, HeaderParserValue::EndOfFile(pos)));
|
||||
|
||||
const auto packValueSupplier = std::make_unique<MockPackValueSupplier>();
|
||||
const auto sequence = std::make_unique<SequenceNamespace>();
|
||||
const auto state = std::make_unique<HeaderParserState>();
|
||||
const auto state = std::make_unique<HeaderParserState>(packValueSupplier.get());
|
||||
|
||||
unsigned consumedTokenCount;
|
||||
auto result = sequence->MatchSequence(lexer.get(), state.get(), consumedTokenCount);
|
||||
|
@ -0,0 +1,8 @@
|
||||
#include "MockPackValueSupplier.h"
|
||||
|
||||
#include "Parsing/Impl/PackDefinitionStreamProxy.h"
|
||||
|
||||
int MockPackValueSupplier::GetCurrentPack() const
|
||||
{
|
||||
return PackDefinitionStreamProxy::DEFAULT_PACK;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/IPackValueSupplier.h"
|
||||
|
||||
class MockPackValueSupplier final : public IPackValueSupplier
|
||||
{
|
||||
public:
|
||||
_NODISCARD int GetCurrentPack() const override;
|
||||
};
|
Reference in New Issue
Block a user