diff options
author | c+1 | 2023-05-18 13:16:49 -0400 |
---|---|---|
committer | c+1 | 2023-05-18 13:16:49 -0400 |
commit | 1b6a28f6a777350ae7e04d06a48cba62a09b2dfb (patch) | |
tree | e2d5da481a2bf5aa9ec5e6fc0bfd2767e234c8d4 /src/token.c | |
parent | a8bfa841540a13aea75fafcf11fe27688f1ea939 (diff) |
re-do all the syntax because why not
Diffstat (limited to 'src/token.c')
-rw-r--r-- | src/token.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/token.c b/src/token.c index e57ecd5..6991399 100644 --- a/src/token.c +++ b/src/token.c @@ -12,3 +12,27 @@ token_t* token_init(int type, char* val) { return token; } + +int char_could_start_keyword(char* character) { + for (int i = 0; i < 27; ++ i) { + if (TOKEN_DEFNAME_FIRST_CHAR_ALLOWED_CHARS[i] == *character) { + return 1; + } + } + + return 0; +} + +int char_could_split_keyword(char* character) { + if (char_could_start_keyword(character)) { + return 1; + } else { + for (int i = 0; i < 12; ++ i) { + if (TOKEN_DEFNAME_SPLIT_CHAR_ALLOWED_CHARS[i] == *character) { + return 1; + } + } + + return 0; + } +} |