mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-15 17:27:57 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
#include "MenuMatcherFactory.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "MenuExpressionMatchers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using namespace menu;
|
||||
|
||||
MenuMatcherFactory::MenuMatcherFactory(const IMatcherForLabelSupplier<SimpleParserValue>* labelSupplier)
|
||||
@ -13,23 +13,20 @@ MenuMatcherFactory::MenuMatcherFactory(const IMatcherForLabelSupplier<SimplePars
|
||||
|
||||
MatcherFactoryWrapper<SimpleParserValue> MenuMatcherFactory::StringChain() const
|
||||
{
|
||||
return Or({
|
||||
And({
|
||||
String(),
|
||||
Loop(String())
|
||||
}).Transform([](const token_list_t& tokens) -> SimpleParserValue
|
||||
{
|
||||
std::ostringstream ss;
|
||||
return Or({And({String(), Loop(String())})
|
||||
.Transform(
|
||||
[](const token_list_t& tokens) -> SimpleParserValue
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
for (const auto& token : tokens)
|
||||
{
|
||||
ss << token.get().StringValue();
|
||||
}
|
||||
for (const auto& token : tokens)
|
||||
{
|
||||
ss << token.get().StringValue();
|
||||
}
|
||||
|
||||
return SimpleParserValue::String(tokens[0].get().GetPos(), new std::string(ss.str()));
|
||||
}),
|
||||
String()
|
||||
});
|
||||
return SimpleParserValue::String(tokens[0].get().GetPos(), new std::string(ss.str()));
|
||||
}),
|
||||
String()});
|
||||
}
|
||||
|
||||
MatcherFactoryWrapper<SimpleParserValue> MenuMatcherFactory::Text() const
|
||||
@ -49,26 +46,24 @@ MatcherFactoryWrapper<SimpleParserValue> MenuMatcherFactory::Numeric() const
|
||||
|
||||
MatcherFactoryWrapper<SimpleParserValue> MenuMatcherFactory::IntExpression() const
|
||||
{
|
||||
return MatcherFactoryWrapper(Or({
|
||||
Integer().Tag(TAG_INT).Capture(CAPTURE_INT),
|
||||
And({
|
||||
Char('(').Capture(CAPTURE_FIRST_TOKEN),
|
||||
Label(MenuExpressionMatchers::LABEL_EXPRESSION),
|
||||
Char(')'),
|
||||
}).Tag(TAG_EXPRESSION)
|
||||
}));
|
||||
return MatcherFactoryWrapper(Or({Integer().Tag(TAG_INT).Capture(CAPTURE_INT),
|
||||
And({
|
||||
Char('(').Capture(CAPTURE_FIRST_TOKEN),
|
||||
Label(MenuExpressionMatchers::LABEL_EXPRESSION),
|
||||
Char(')'),
|
||||
})
|
||||
.Tag(TAG_EXPRESSION)}));
|
||||
}
|
||||
|
||||
MatcherFactoryWrapper<SimpleParserValue> MenuMatcherFactory::NumericExpression() const
|
||||
{
|
||||
return MatcherFactoryWrapper(Or({
|
||||
Numeric().Tag(TAG_NUMERIC).Capture(CAPTURE_NUMERIC),
|
||||
And({
|
||||
Char('(').Capture(CAPTURE_FIRST_TOKEN),
|
||||
Label(MenuExpressionMatchers::LABEL_EXPRESSION),
|
||||
Char(')'),
|
||||
}).Tag(TAG_EXPRESSION)
|
||||
}));
|
||||
return MatcherFactoryWrapper(Or({Numeric().Tag(TAG_NUMERIC).Capture(CAPTURE_NUMERIC),
|
||||
And({
|
||||
Char('(').Capture(CAPTURE_FIRST_TOKEN),
|
||||
Label(MenuExpressionMatchers::LABEL_EXPRESSION),
|
||||
Char(')'),
|
||||
})
|
||||
.Tag(TAG_EXPRESSION)}));
|
||||
}
|
||||
|
||||
int MenuMatcherFactory::TokenNumericIntValue(const SimpleParserValue& value)
|
||||
|
Reference in New Issue
Block a user