From 25c776cfff3ca1693a7d7f3c49ad3ad94d999002 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 29 Oct 2023 21:14:49 +0100 Subject: [PATCH] refactor: FilterParser (#4925) * Make explainIllType anonymous/static * Comment constructor --- src/controllers/filters/lang/FilterParser.cpp | 8 +++++++- src/controllers/filters/lang/FilterParser.hpp | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/controllers/filters/lang/FilterParser.cpp b/src/controllers/filters/lang/FilterParser.cpp index 00e3bf77..dddbd164 100644 --- a/src/controllers/filters/lang/FilterParser.cpp +++ b/src/controllers/filters/lang/FilterParser.cpp @@ -9,7 +9,9 @@ #include "controllers/filters/lang/Filter.hpp" #include "controllers/filters/lang/Types.hpp" -namespace chatterino::filters { +namespace { + +using namespace chatterino::filters; QString explainIllType(const IllTyped &ill) { @@ -18,6 +20,10 @@ QString explainIllType(const IllTyped &ill) .arg(ill.expr->filterString()); } +} // namespace + +namespace chatterino::filters { + FilterParser::FilterParser(const QString &text) : text_(text) , tokenizer_(Tokenizer(text)) diff --git a/src/controllers/filters/lang/FilterParser.hpp b/src/controllers/filters/lang/FilterParser.hpp index 3f034462..1fa8fa59 100644 --- a/src/controllers/filters/lang/FilterParser.hpp +++ b/src/controllers/filters/lang/FilterParser.hpp @@ -9,6 +9,9 @@ namespace chatterino::filters { class FilterParser { public: + /** + * Take input text & attempt to parse it into a filter + **/ FilterParser(const QString &text); bool valid() const;