mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-08-01 12:50:36 +00:00
* fix(menu): allow IW4 columns without alignment * feat: also make alignment optional for iw5 menus * chore: move menu sequences to anonymous namespace if possible --------- Co-authored-by: Jan Laupetin <[email protected]>
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#include "NoScopeSequences.h"
|
|
|
|
#include "Generic/GenericStringPropertySequence.h"
|
|
#include "Parsing/Menu/Matcher/MenuMatcherFactory.h"
|
|
|
|
using namespace menu;
|
|
|
|
namespace
|
|
{
|
|
class SequenceOpenGlobalScope final : public MenuFileParser::sequence_t
|
|
{
|
|
public:
|
|
SequenceOpenGlobalScope()
|
|
{
|
|
const MenuMatcherFactory create(this);
|
|
|
|
AddMatchers({
|
|
create.Char('{'),
|
|
});
|
|
}
|
|
|
|
protected:
|
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override
|
|
{
|
|
state->m_in_global_scope = true;
|
|
}
|
|
};
|
|
} // namespace
|
|
|
|
NoScopeSequences::NoScopeSequences(std::vector<std::unique_ptr<MenuFileParser::sequence_t>>& allSequences,
|
|
std::vector<MenuFileParser::sequence_t*>& scopeSequences)
|
|
: AbstractScopeSequenceHolder(allSequences, scopeSequences)
|
|
{
|
|
}
|
|
|
|
void NoScopeSequences::AddSequences(const FeatureLevel featureLevel, const bool permissive) const
|
|
{
|
|
AddSequence(std::make_unique<SequenceOpenGlobalScope>());
|
|
}
|