From 8707ae6fd4e0378014240f57e0810504d7243714 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 30 Jul 2018 10:00:38 +0200 Subject: [PATCH] Songfilter: allow redundant parantheses --- src/SongFilter.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SongFilter.cxx b/src/SongFilter.cxx index a2a009649..d47926726 100644 --- a/src/SongFilter.cxx +++ b/src/SongFilter.cxx @@ -320,8 +320,15 @@ SongFilter::ParseExpression(const char *&s, bool fold_case) s = StripLeft(s + 1); - if (*s == '(') + if (*s == '(') { + auto first = ParseExpression(s, fold_case); + if (*s == ')') { + ++s; + return first; + } + throw std::runtime_error("Nested expressions not yet implemented"); + } auto type = ExpectFilterType(s);