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:
parent
bacd3dd57a
commit
137d68a2ae
5 changed files with 32 additions and 16 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue