Files
scc/libs/pprocessor/include/pp_token.h
zzy 09f4ac8de0 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
2025-12-28 10:49:29 +08:00

31 lines
1.2 KiB
C

#ifndef __SCC_PP_TOKEN_H__
#define __SCC_PP_TOKEN_H__
/* clang-format off */
/// https://cppreference.cn/w/c/preprocessor
#define SCC_PP_INST_TOKEN \
X(define , SCC_PP_STD, SCC_PP_TOK_DEFINE ) \
X(elif , SCC_PP_STD, SCC_PP_TOK_ELIF ) \
X(elifdef , SCC_PP_STD, SCC_PP_TOK_ELIFDEF ) \
X(elifndef , SCC_PP_STD, SCC_PP_TOK_ELIFNDEF ) \
X(else , SCC_PP_STD, SCC_PP_TOK_ELSE ) \
X(embed , SCC_PP_STD, SCC_PP_TOK_EMBED ) \
X(endif , SCC_PP_STD, SCC_PP_TOK_ENDIF ) \
X(error , SCC_PP_STD, SCC_PP_TOK_ERROR ) \
X(if , SCC_PP_STD, SCC_PP_TOK_IF ) \
X(ifdef , SCC_PP_C23, SCC_PP_TOK_IFDEF ) \
X(ifndef , SCC_PP_STD, SCC_PP_TOK_IFNDEF ) \
X(include , SCC_PP_STD, SCC_PP_TOK_INCLUDE ) \
X(line , SCC_PP_C23, SCC_PP_TOK_LINE ) \
X(pragma , SCC_PP_STD, SCC_PP_TOK_PRAGMA ) \
X(undef , SCC_PP_C23, SCC_PP_TOK_UNDEF ) \
X(warning , SCC_PP_STD, SCC_PP_TOK_WARNING ) \
// END
/* clang-format on */
#define X(name, type, tok) tok,
typedef enum scc_pp_token { SCC_PP_INST_TOKEN } scc_pp_token_t;
#undef X
#endif /* __SCC_PP_TOKEN_H__ */