summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-03-12 12:46:40 +0200
committerAndreas Kling <kling@serenityos.org>2021-03-13 10:17:02 +0100
commit5cd1c69b968293ac95f51c68f2a78b16c671cf58 (patch)
tree705bed5ae8d42ff4b9df8ca7e06dc7866151e52a /Userland/Libraries/LibCpp/SyntaxHighlighter.cpp
parentd0b4f9cc0e7110ba540d09c0244ff69aa19ad27f (diff)
downloadserenity-5cd1c69b968293ac95f51c68f2a78b16c671cf58.zip
LibCpp: Access Cpp::Token members via getter functions
Diffstat (limited to 'Userland/Libraries/LibCpp/SyntaxHighlighter.cpp')
-rw-r--r--Userland/Libraries/LibCpp/SyntaxHighlighter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp b/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp
index 762257678c..662278d953 100644
--- a/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp
+++ b/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp
@@ -83,15 +83,15 @@ void SyntaxHighlighter::rehighlight(const Palette& palette)
Vector<GUI::TextDocumentSpan> spans;
for (auto& token : tokens) {
- dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.to_string(), token.m_start.line, token.m_start.column, token.m_end.line, token.m_end.column);
+ dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.to_string(), token.start().line, token.start().column, token.end().line, token.end().column);
GUI::TextDocumentSpan span;
- span.range.set_start({ token.m_start.line, token.m_start.column });
- span.range.set_end({ token.m_end.line, token.m_end.column });
- auto style = style_for_token_type(palette, token.m_type);
+ span.range.set_start({ token.start().line, token.start().column });
+ span.range.set_end({ token.end().line, token.end().column });
+ auto style = style_for_token_type(palette, token.type());
span.attributes.color = style.color;
span.attributes.bold = style.bold;
- span.is_skippable = token.m_type == Cpp::Token::Type::Whitespace;
- span.data = reinterpret_cast<void*>(token.m_type);
+ span.is_skippable = token.type() == Cpp::Token::Type::Whitespace;
+ span.data = reinterpret_cast<void*>(token.type());
spans.append(span);
}
m_client->do_set_spans(move(spans));