Make parenthesis when using menu boolean expression optional

This commit is contained in:
Jan 2021-12-01 18:16:58 +01:00
parent 74988af30b
commit a8126e2db3

View File

@ -53,15 +53,8 @@ std::unique_ptr<GenericExpressionPropertySequence> GenericExpressionPropertySequ
const MenuMatcherFactory create(result.get());
result->AddMatchers({
create.KeywordIgnoreCase(std::move(keyword)).Capture(CAPTURE_FIRST_TOKEN),
create.Or({
create.And({
create.KeywordIgnoreCase("when"),
create.Char('('),
create.Label(MenuExpressionMatchers::LABEL_EXPRESSION),
create.Char(')')
}),
create.Label(MenuExpressionMatchers::LABEL_EXPRESSION)
}),
create.Optional(create.KeywordIgnoreCase("when")),
create.Label(MenuExpressionMatchers::LABEL_EXPRESSION),
create.Optional(create.Char(';'))
});