Compare commits

...

2 Commits

Author SHA1 Message Date
5032e2aabb +TODO 2023-09-20 08:51:02 +02:00
314460f575 spec update 2023-09-20 08:50:57 +02:00
2 changed files with 25 additions and 3 deletions

View File

@ -11,15 +11,21 @@ These functions are responsible for the library's "life time".
```C
#define HLPATH ~/.local/hl/:~/.vim/syntax/
```
Coma separated list of directories to be searched for syntax scripts. `#undef` to disable it entirely.
```C
void render_string(const char * const string, const char * const mode); //XXX: rename
```
This function matches _string_ against all known highlighting rules and dispatches the appropriate callback depending on _mode_.
```C
#define HLPATH //?!
int token_fits(const token_t * const token, const char * const to, const int string_offset, const bool is_start_of_line, int * match_offset);
```
Coma separated list of directories to be searched for syntax scripts. `#undef` to disable it entirely.
Fit a specific token against a string. `render_string()` uses this function internally.
```C
@ -82,7 +88,12 @@ There are also convinience functions:
```C
// NOTE: the return value is the number tokens successfully inserted
int new_keyword_tokens(const char * const * words, hl_group_t * const g); // _words_ must be NULL terminated
int new_syntax_character_tokens(const char * const chars, hl_group_t * const g);
int new_syntax_char_tokens(const char * const chars, hl_group_t * const g);
token_t * new_symbol_token(const char * const c, hl_group_t * const g);
int new_symbol_tokens(const char * const * symbols, hl_group_t * const g);
int new_char_tokens(const char * str, hl_group_t * const g);
token_t * new_keyword_token(const char * const word, hl_group_t * const g);
token_t * new_region_token(const char * start, const char * end, hl_group_t * g);
```

11
TODO.md Normal file
View File

@ -0,0 +1,11 @@
[ ] script lexer
[ ] xighlight like all-in-one wrapper for the lexer
[ ] make init() lex #ifdef HLPATH
[ ] $HLPATH traversing
[ ] cli parser
[ ] jeger segfault
[ ] replace assert checks (long jump and set errno)
[ ] token\_table\_t, functions to manage them and modification to existing funtions taking the global for granted
[ ] do we fucking need keysymbol?
[ ] new_symbol_tokens() and new_char_tokens() are confusing
[ ] figure out how to allow regex engine overridding