Open History to see the last commit
1#ifndef T3_HIGHLIGHTS_H
2#define T3_HIGHLIGHTS_H
3
4#include <stddef.h>
5#include <stdint.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/**
12 * Lexes UTF-8 `source` with @pierre/highlights language `language` and points
13 * `records` at `(endUtf16, tokenId)` pairs. A token ID of UINT32_MAX ends a
14 * line, and its end value is where the next line starts. The records stay
15 * valid until the next call. Returns the number of uint32 values, or -1 when
16 * the lexer could not run.
17 *
18 * Not thread-safe: callers serialize access.
19 */
20int64_t t3_highlights_tokenize(const uint8_t* source, size_t length, uint8_t language,
21 const uint32_t** records);
22
23#ifdef __cplusplus
24}
25#endif
26
27#endif