hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/ui/source_view.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-02-13 22:33:29 +0100
committerhachem <im@hachem.wtf>2025-02-13 22:33:29 +0100
commit1200df8a9a60490ac6b783dc8dd11f67b1ba0721 (patch)
treed48905f4faad20271db6ff52d5962c0ed8f7eeeb /src/ui/source_view.h
parent1cdd9d221a9cbee38ae52fe88b5f65d82fe319c0 (diff)
feat: syntax highlighting
Diffstat (limited to 'src/ui/source_view.h')
-rw-r--r--src/ui/source_view.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/source_view.h b/src/ui/source_view.h
index 94855e8..9bea9d8 100644
--- a/src/ui/source_view.h
+++ b/src/ui/source_view.h
@@ -11,6 +11,24 @@ namespace Hsdbg
{
class Debugger;
+ enum class SyntaxKind : uint8_t
+ {
+ Default,
+ Keyword,
+ Type,
+ String,
+ Number,
+ Comment,
+ Preprocessor,
+ };
+
+ struct SourceSpan
+ {
+ uint32_t start;
+ uint32_t length;
+ SyntaxKind kind;
+ };
+
class SourceView
{
public:
@@ -31,6 +49,8 @@ namespace Hsdbg
std::filesystem::path m_path;
std::vector<std::string> m_lines;
+ std::vector<std::vector<SourceSpan>> m_spans;
+ bool m_highlight = false;
std::string m_path_input;
std::string m_error;
uint32_t m_highlighted_line = 0;