aboutsummaryrefslogtreecommitdiff
path: root/src/token.c
diff options
context:
space:
mode:
authorc+12023-05-18 13:16:49 -0400
committerc+12023-05-18 13:16:49 -0400
commit1b6a28f6a777350ae7e04d06a48cba62a09b2dfb (patch)
treee2d5da481a2bf5aa9ec5e6fc0bfd2767e234c8d4 /src/token.c
parenta8bfa841540a13aea75fafcf11fe27688f1ea939 (diff)
re-do all the syntax because why not
Diffstat (limited to 'src/token.c')
-rw-r--r--src/token.c24
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;
+ }
+}