22 lines
433 B
C
22 lines
433 B
C
#ifndef SYNTAX_HIGHLIGHTER_H_
|
|
#define SYNTAX_HIGHLIGHTER_H_
|
|
|
|
|
|
// Color codes that only affect foreground, preserving your background color
|
|
#define COLOR_RESET "\x1b[39m" // Reset all (4 bytes)
|
|
|
|
// Token types
|
|
typedef enum {
|
|
TOKEN_KEYWORD,
|
|
TOKEN_TYPE,
|
|
TOKEN_STRING,
|
|
TOKEN_COMMENT,
|
|
TOKEN_NUMBER,
|
|
TOKEN_OPERATOR,
|
|
TOKEN_DEFAULT
|
|
} TokenType;
|
|
|
|
char *highlight_line(const char * line, int *length);
|
|
|
|
#endif
|