Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@ -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)