1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:15:09 +00:00

HackStudio: Abstract over syntax highlighter

This commit is contained in:
Oriko 2020-03-12 17:23:54 +02:00 committed by Andreas Kling
parent bacd3dd57a
commit 137d68a2ae
5 changed files with 32 additions and 16 deletions

View file

@ -37,6 +37,18 @@ static TextStyle style_for_token_type(CppToken::Type type)
}
}
bool CppSyntaxHighlighter::is_identifier(void* token) const
{
auto cpp_token = static_cast<GUI::CppToken::Type>(reinterpret_cast<size_t>(token));
return cpp_token == GUI::CppToken::Type::Identifier;
}
bool CppSyntaxHighlighter::is_navigatable(void* token) const
{
auto cpp_token = static_cast<GUI::CppToken::Type>(reinterpret_cast<size_t>(token));
return cpp_token == GUI::CppToken::Type::IncludePath;
}
void CppSyntaxHighlighter::rehighlight()
{
ASSERT(m_editor);