mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-09-10 07:57:05 +00:00
* fix(menu): accept numeric `dvarStrList` values Convert numeric tokens to strings to match the game menu parser behaviour. https://github.com/Laupetin/OpenAssetTools/issues/160 * chore: rename TextOrNumericNoChain to TextNoChainOrNumeric --------- Co-authored-by: Jan Laupetin <[email protected]>
46 lines
2.3 KiB
C++
46 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include "Parsing/Menu/MenuFileParserState.h"
|
|
#include "Parsing/Sequence/SequenceResult.h"
|
|
#include "Parsing/Simple/Matcher/SimpleMatcherFactory.h"
|
|
|
|
namespace menu
|
|
{
|
|
class MenuMatcherFactory : public SimpleMatcherFactory
|
|
{
|
|
static constexpr auto TAG_STRING_CHAIN = 1420;
|
|
static constexpr auto TAG_IDENTIFIER = 1421;
|
|
static constexpr auto TAG_INT = 1422;
|
|
static constexpr auto TAG_NUMERIC = 1423;
|
|
static constexpr auto TAG_EXPRESSION = 1424;
|
|
|
|
static constexpr auto CAPTURE_FIRST_TOKEN = 1420;
|
|
static constexpr auto CAPTURE_STRING_CHAIN = 1421;
|
|
static constexpr auto CAPTURE_IDENTIFIER = 1422;
|
|
static constexpr auto CAPTURE_INT = 1423;
|
|
static constexpr auto CAPTURE_NUMERIC = 1424;
|
|
|
|
public:
|
|
explicit MenuMatcherFactory(const IMatcherForLabelSupplier<SimpleParserValue>* labelSupplier);
|
|
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> StringChain() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Text() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> TextOrNumeric() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> TextNoChain() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> TextNoChainOrNumeric() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> Numeric() const;
|
|
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> TextExpression() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> IntExpression() const;
|
|
[[nodiscard]] MatcherFactoryWrapper<SimpleParserValue> NumericExpression() const;
|
|
|
|
[[nodiscard]] static int TokenNumericIntValue(const SimpleParserValue& value);
|
|
[[nodiscard]] static double TokenNumericFloatingPointValue(const SimpleParserValue& value);
|
|
[[nodiscard]] static std::string& TokenTextValue(const SimpleParserValue& value);
|
|
|
|
[[nodiscard]] static std::string TokenTextExpressionValue(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result);
|
|
[[nodiscard]] static int TokenIntExpressionValue(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result);
|
|
[[nodiscard]] static double TokenNumericExpressionValue(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result);
|
|
};
|
|
} // namespace menu
|