feat(lexer): 在换行符处理时添加流回退功能
在词法分析器中遇到换行符时,添加对 scc_probe_stream_back 的调用, 以确保流探针位置正确回退。同时修正了 probe_stream_t 接口定义中的 注释说明,明确 back 函数的作用是后退探针位置而非头指针位置。 修复了内存探针流实现中回退逻辑的边界条件判断, 现在能够正确处理探针位置的回退操作。
This commit is contained in:
@@ -30,15 +30,15 @@ struct scc_probe_stream {
|
||||
/// @brief 移动探针位置并返回字符
|
||||
int (*next)(scc_probe_stream_t *stream);
|
||||
|
||||
/// @brief 回退一个字符(单次后退,探针位置后退一步)
|
||||
cbool (*back)(scc_probe_stream_t *stream);
|
||||
|
||||
/// @brief 移动头指针到探针位置
|
||||
void (*sync)(scc_probe_stream_t *stream);
|
||||
|
||||
/// @brief 重置探针位置到头指针位置
|
||||
void (*reset)(scc_probe_stream_t *stream);
|
||||
|
||||
/// @brief 回退一个字符(单次后退,头指针后退一步)
|
||||
cbool (*back)(scc_probe_stream_t *stream);
|
||||
|
||||
/// @brief 读取指定数量的字符到缓冲区
|
||||
usize (*read_buf)(scc_probe_stream_t *stream, char *buffer, usize count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user