diff options
Diffstat (limited to 'src/token.c')
-rw-r--r-- | src/token.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/token.c b/src/token.c index 6991399..9ea2ccf 100644 --- a/src/token.c +++ b/src/token.c @@ -14,7 +14,7 @@ token_t* token_init(int type, char* val) { } int char_could_start_keyword(char* character) { - for (int i = 0; i < 27; ++ i) { + for (int i = 0; i < TOKEN_DEFNAME_FIRST_CHAR_ALLOWED_CHARS_LEN; ++ i) { if (TOKEN_DEFNAME_FIRST_CHAR_ALLOWED_CHARS[i] == *character) { return 1; } @@ -27,7 +27,7 @@ int char_could_split_keyword(char* character) { if (char_could_start_keyword(character)) { return 1; } else { - for (int i = 0; i < 12; ++ i) { + for (int i = 0; i < TOKEN_DEFNAME_SPLIT_CHAR_ALLOWED_CHARS_LEN; ++ i) { if (TOKEN_DEFNAME_SPLIT_CHAR_ALLOWED_CHARS[i] == *character) { return 1; } @@ -36,3 +36,13 @@ int char_could_split_keyword(char* character) { return 0; } } + +int char_can_ignore(char* character) { + for (int i = 0; i < TOKEN_CHAR_IGNORE_LEN; ++ i) { + if (TOKEN_CHAR_IGNORE[i] == *character) { + return 1; + } + } + + return 0; +} |