mirror of
https://github.com/karpathy/nanochat.git
synced 2026-02-22 03:20:23 +00:00
22 lines
392 B
C
22 lines
392 B
C
#ifndef FAST_REGEX_H
|
|
#define FAST_REGEX_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
typedef struct {
|
|
size_t start, end;
|
|
} TokenPos;
|
|
|
|
typedef struct {
|
|
TokenPos *splits;
|
|
size_t count;
|
|
size_t capacity;
|
|
} TokenList;
|
|
|
|
void tokenlist_init(TokenList *list);
|
|
void tokenlist_free(TokenList *list);
|
|
void tokenize_fast(const char *input, size_t input_len, TokenList *out);
|
|
|
|
#endif // FAST_REGEX_H
|