feat(lex_parser, pprocessor): replace consume with next and remove stream resets
- Replace `scc_probe_stream_consume` with `scc_probe_stream_next` for consistent stream advancement - Remove redundant `scc_probe_stream_reset` calls before peeking, as `next` and `peek` handle state - Update `scc_cstring_new` to `scc_cstring_create` and `scc_pos_init` to `scc_pos_create` for naming consistency - Change `scc_pp_macro_get` parameter to `const scc_cstring_t*` for better const-correctness - Improves code clarity and maintains proper stream position tracking
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
typedef enum {
|
||||
SCC_PP_MACRO_OBJECT, // 对象宏
|
||||
SCC_PP_MACRO_FUNCTION, // 函数宏
|
||||
SCC_PP_MACRO_NONE, // 不是宏
|
||||
} scc_pp_macro_type_t;
|
||||
|
||||
typedef SCC_VEC(scc_cstring_t) scc_pp_macro_list_t;
|
||||
@@ -79,7 +80,7 @@ scc_pp_macro_t *scc_pp_macro_table_set(scc_pp_macro_table_t *pp,
|
||||
* @return 找到的宏对象指针,未找到返回NULL
|
||||
*/
|
||||
scc_pp_macro_t *scc_pp_macro_table_get(scc_pp_macro_table_t *pp,
|
||||
scc_cstring_t *name);
|
||||
const scc_cstring_t *name);
|
||||
|
||||
/**
|
||||
* @brief 从预处理器中删除宏
|
||||
|
||||
Reference in New Issue
Block a user