Add stats on itemfilter

This commit is contained in:
Héctor Giménez
2023-03-13 21:28:49 +09:00
parent 04c30b2fe8
commit a1a86b9e05
3 changed files with 310 additions and 6 deletions

View File

@@ -92,6 +92,15 @@ func reGroupParentheses(operands, groups []string) ([]string, []string) {
currentGroupContent := ""
for i, group := range groups {
group = strings.TrimSpace(group)
if strings.Contains(group, "(") && strings.Contains(group, ")") {
group = strings.ReplaceAll(group, "(", "")
group = strings.ReplaceAll(group, ")", "")
cleanGroups = append(cleanGroups, group)
if i < len(operands) {
cleanOperands = append(cleanOperands, operands[i])
}
continue
}
if strings.Contains(group, "(") || (inGroup && !strings.Contains(group, ")")) {
inGroup = true
currentGroupContent += strings.ReplaceAll(group, "(", "") + operands[i]