Skip to content

Commit

Permalink
fix #470
Browse files Browse the repository at this point in the history
  • Loading branch information
NiumXp committed Jan 23, 2024
1 parent 7de5543 commit 49cfaf6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions norminette/rules/is_preprocessor_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
)


Expand Down
12 changes: 11 additions & 1 deletion tests/rules/samples/check_preprocessor_include.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ void main(void);

#if 1
# include "ok but not ok.h"
#endif
#endif

#include <float.h>
#include <int.h>
#include <char.h>
#include <wchar.h>
#include <if.h>
#include <else.h>
#include <bool.h>
#include <null.h>
#include <NULL.h>

0 comments on commit 49cfaf6

Please sign in to comment.