mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
HackStudio: Abstract over syntax highlighter
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 08:20:36 +09:00
Author: https://github.com/oriko1010 Commit: https://github.com/SerenityOS/serenity/commit/137d68a2aee Pull-request: https://github.com/SerenityOS/serenity/pull/1429 Reviewed-by: https://github.com/awesomekling
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user