mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-05-07 13:04:58 +00:00
refactor: remove name sequence from zcg commands
This commit is contained in:
parent
0103e4631f
commit
68ee502c72
@ -35,5 +35,4 @@ public:
|
|||||||
|
|
||||||
std::unique_ptr<CustomAction> m_post_load_action;
|
std::unique_ptr<CustomAction> m_post_load_action;
|
||||||
const FastFileBlock* m_block;
|
const FastFileBlock* m_block;
|
||||||
std::vector<MemberInformation*> m_name_chain;
|
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include "Parsing/Commands/Sequence/SequenceCondition.h"
|
#include "Parsing/Commands/Sequence/SequenceCondition.h"
|
||||||
#include "Parsing/Commands/Sequence/SequenceCount.h"
|
#include "Parsing/Commands/Sequence/SequenceCount.h"
|
||||||
#include "Parsing/Commands/Sequence/SequenceGame.h"
|
#include "Parsing/Commands/Sequence/SequenceGame.h"
|
||||||
#include "Parsing/Commands/Sequence/SequenceName.h"
|
|
||||||
#include "Parsing/Commands/Sequence/SequenceReorder.h"
|
#include "Parsing/Commands/Sequence/SequenceReorder.h"
|
||||||
#include "Parsing/Commands/Sequence/SequenceReusable.h"
|
#include "Parsing/Commands/Sequence/SequenceReusable.h"
|
||||||
#include "Parsing/Commands/Sequence/SequenceScriptString.h"
|
#include "Parsing/Commands/Sequence/SequenceScriptString.h"
|
||||||
@ -39,7 +38,6 @@ const std::vector<CommandsParser::sequence_t*>& CommandsParser::GetTestsForState
|
|||||||
new SequenceCondition(),
|
new SequenceCondition(),
|
||||||
new SequenceCount(),
|
new SequenceCount(),
|
||||||
new SequenceGame(),
|
new SequenceGame(),
|
||||||
new SequenceName(),
|
|
||||||
new SequenceReorder(),
|
new SequenceReorder(),
|
||||||
new SequenceReusable(),
|
new SequenceReusable(),
|
||||||
new SequenceScriptString(),
|
new SequenceScriptString(),
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
#include "SequenceName.h"
|
|
||||||
|
|
||||||
#include "Parsing/Commands/Matcher/CommandsCommonMatchers.h"
|
|
||||||
#include "Parsing/Commands/Matcher/CommandsMatcherFactory.h"
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
static constexpr auto CAPTURE_TYPE = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
SequenceName::SequenceName()
|
|
||||||
{
|
|
||||||
const CommandsMatcherFactory create(this);
|
|
||||||
|
|
||||||
AddLabeledMatchers(CommandsCommonMatchers::Typename(this), CommandsCommonMatchers::LABEL_TYPENAME);
|
|
||||||
AddMatchers({
|
|
||||||
create.Keyword("set"),
|
|
||||||
create.Keyword("name"),
|
|
||||||
create.Label(CommandsCommonMatchers::LABEL_TYPENAME).Capture(CAPTURE_TYPE),
|
|
||||||
create.Char(';'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void SequenceName::ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const
|
|
||||||
{
|
|
||||||
const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE);
|
|
||||||
|
|
||||||
StructureInformation* type;
|
|
||||||
std::vector<MemberInformation*> members;
|
|
||||||
if (!state->GetTypenameAndMembersFromTypename(typeNameToken.TypeNameValue(), type, members))
|
|
||||||
throw ParsingException(typeNameToken.GetPos(), "Unknown type");
|
|
||||||
|
|
||||||
if (members.empty())
|
|
||||||
throw ParsingException(typeNameToken.GetPos(), "Need to specify a member when trying to set to a structure name.");
|
|
||||||
|
|
||||||
type->m_name_chain = std::move(members);
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Parsing/Commands/Impl/CommandsParser.h"
|
|
||||||
|
|
||||||
class SequenceName final : public CommandsParser::sequence_t
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SequenceName();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const override;
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user