aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-01-14 23:08:41 +0900
committernsfisis <nsfisis@gmail.com>2026-01-17 00:27:28 +0900
commit34c0d53cdfae632796866fd3884357c8237cdeab (patch)
tree642f5b88568aeeba1ac29c05ae9794bff73522c0
parentc37878302934f9d372e327612bef37da1c8e3a65 (diff)
downloadducc-34c0d53cdfae632796866fd3884357c8237cdeab.tar.gz
ducc-34c0d53cdfae632796866fd3884357c8237cdeab.tar.zst
ducc-34c0d53cdfae632796866fd3884357c8237cdeab.zip
feat: ignore #pragma directives in preprocessor
-rw-r--r--src/preprocess.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/preprocess.c b/src/preprocess.c
index ed9dd8b..56c775d 100644
--- a/src/preprocess.c
+++ b/src/preprocess.c
@@ -1118,8 +1118,11 @@ static void preprocess_warning_directive(Preprocessor* pp) {
fprintf(stderr, "%s:%d: %s", msg->loc.filename, msg->loc.line, msg->value.string);
}
-static void preprocess_pragma_directive(Preprocessor*) {
- unimplemented();
+static void preprocess_pragma_directive(Preprocessor* pp) {
+ // Ignore all #pragma directives for now.
+ skip_pp_token(pp, TokenKind_pp_directive_pragma);
+ seek_to_next_newline(pp);
+ skip_pp_token(pp, TokenKind_newline);
}
static void preprocess_nop_directive(Preprocessor* pp) {