feat(lex_parser, pprocessor): rename identifier header check and add macro system
- Rename `scc_lex_parse_is_identifier_header` to `scc_lex_parse_is_identifier_prefix` for clarity and add a TODO comment - Update lexer to use the renamed function for consistency - Fix package and dependency names in `cbuild.toml` (`smcc_pprocesser` → `scc_pprocesser`, `smcc_lex_parser` → `lex_parser`) - Introduce new macro system with header file `pp_macro.h` defining macro types, structures, and management functions - Refactor preprocessor initialization and cleanup in `pprocessor.c` to use new macro table and stream handling - Replace legacy `hashmap` with `scc_pp_macro_table_t` for macro storage - Improve error handling and resource management in preprocessor lifecycle
This commit is contained in:
@@ -136,7 +136,13 @@ static inline void scc_cstring_append_ch(scc_cstring_t *str, char ch) {
|
||||
* @return usize 字符串实际长度
|
||||
*/
|
||||
static inline usize scc_cstring_len(const scc_cstring_t *str) {
|
||||
return str ? str->size - 1 : 0;
|
||||
if (str == null) {
|
||||
return 0;
|
||||
}
|
||||
if (str->size == 0) {
|
||||
return 0;
|
||||
}
|
||||
return str->size - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user