summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSyntax
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2022-12-19 19:13:18 +0100
committerTim Flynn <trflynn89@pm.me>2022-12-19 14:13:50 -0500
commitb00865bce5ff8d3a9374c2853bcbbe40079e647e (patch)
treee93eedfabb2a59419360315a947225b9723cd862 /Userland/Libraries/LibSyntax
parent3c2227ceed58cc64e61fc1ad7455cfd522fcd65a (diff)
downloadserenity-b00865bce5ff8d3a9374c2853bcbbe40079e647e.zip
LibSyntax+TextEditor: Move Highlighter::language_string() out of class
Diffstat (limited to 'Userland/Libraries/LibSyntax')
-rw-r--r--Userland/Libraries/LibSyntax/Highlighter.cpp2
-rw-r--r--Userland/Libraries/LibSyntax/Highlighter.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibSyntax/Highlighter.cpp b/Userland/Libraries/LibSyntax/Highlighter.cpp
index a3e97d6ac2..cf4250bcf2 100644
--- a/Userland/Libraries/LibSyntax/Highlighter.cpp
+++ b/Userland/Libraries/LibSyntax/Highlighter.cpp
@@ -138,7 +138,7 @@ void Highlighter::register_nested_token_pairs(Vector<MatchingTokenPair> pairs)
m_nested_token_pairs.set(pair);
}
-StringView Highlighter::language_string(Language language) const
+StringView language_to_string(Language language)
{
switch (language) {
case Language::Cpp:
diff --git a/Userland/Libraries/LibSyntax/Highlighter.h b/Userland/Libraries/LibSyntax/Highlighter.h
index 8ca7b93cec..21952ec6a6 100644
--- a/Userland/Libraries/LibSyntax/Highlighter.h
+++ b/Userland/Libraries/LibSyntax/Highlighter.h
@@ -32,6 +32,8 @@ struct TextStyle {
bool const bold { false };
};
+StringView language_to_string(Language);
+
class Highlighter {
AK_MAKE_NONCOPYABLE(Highlighter);
AK_MAKE_NONMOVABLE(Highlighter);
@@ -40,7 +42,6 @@ public:
virtual ~Highlighter() = default;
virtual Language language() const = 0;
- StringView language_string(Language) const;
virtual Optional<StringView> comment_prefix() const = 0;
virtual Optional<StringView> comment_suffix() const = 0;
virtual void rehighlight(Palette const&) = 0;