smcc/lib/utils/tokbuf/token.c
ZZY 05c637e594 refactor: 重构前端代码并添加日志功能
- 重命名和重构了多个文件,包括 lexer、parser 和 AST 相关代码
- 添加了日志功能,使用 LOG_* 宏替代原有的 error 和 warn 函数
- 优化了错误处理和内存分配方式
- 调整了代码结构,提高了模块化和可读性
2025-03-19 12:22:55 +08:00

20 lines
641 B
C

// #include <lib/rt/rt.h>
// #include "token.h"
// #define ROUND_IDX(idx) ((idx) % tokbuf->cap)
// #define POW2(x) (1 << (x))
// void init_toks(tok_stream_t* tokbuf, int cap,
// tok_stream_close_func close, tok_stream_get_func gettok, void* stream)
// {
// tokbuf->cap_mask = POW2(cap) - 1;
// // tokbuf->buf =
// }
// int toks_next( tok_stream_t* toks, tok_t* out);
// int toks_peek( tok_stream_t* toks, tok_t* out, int lookahead);
// const tok_t* toks_peek_ref(tok_stream_t* toks, int lookahead);
// int toks_reset(tok_stream_t* toks);
// int toks_seek( tok_stream_t* toks, int pos);
// int toks_close(tok_stream_t* toks);