From 49cfaf6f080d292867ef961cb4d3e770a41ffe8d Mon Sep 17 00:00:00 2001 From: NiumXp Date: Tue, 23 Jan 2024 18:44:21 -0300 Subject: [PATCH] fix #470 --- norminette/rules/is_preprocessor_statement.py | 3 +++ tests/rules/samples/check_preprocessor_include.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/norminette/rules/is_preprocessor_statement.py b/norminette/rules/is_preprocessor_statement.py index 12eb34c1..29ffad12 100644 --- a/norminette/rules/is_preprocessor_statement.py +++ b/norminette/rules/is_preprocessor_statement.py @@ -2,6 +2,7 @@ import contextlib from norminette.rules import Rule, Primary +from norminette.lexer.dictionary import keywords from norminette.exceptions import CParsingError from norminette.context import Macro @@ -45,6 +46,8 @@ "DOT", "SPACE", "TAB", + # TODO Remove all keyword tokens and add to just use 'IDENTIFIER' instead + *keywords.values(), # https://github.com/42School/norminette/issues/470 ) diff --git a/tests/rules/samples/check_preprocessor_include.c b/tests/rules/samples/check_preprocessor_include.c index 63bba19c..d6dd5197 100644 --- a/tests/rules/samples/check_preprocessor_include.c +++ b/tests/rules/samples/check_preprocessor_include.c @@ -9,4 +9,14 @@ void main(void); #if 1 # include "ok but not ok.h" -#endif \ No newline at end of file +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include