aboutsummaryrefslogtreecommitdiff
path: root/src/token.c
diff options
context:
space:
mode:
authorc+12023-05-18 13:28:04 -0400
committerc+12023-05-18 13:28:04 -0400
commitca2fbad75901c661d8d5e1dea574b8074dbc56ba (patch)
tree318244e62e9747f347b9f2bcc33ebaa7fb1d85ae /src/token.c
parent1b6a28f6a777350ae7e04d06a48cba62a09b2dfb (diff)
moar
Diffstat (limited to 'src/token.c')
-rw-r--r--src/token.c14
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;
+}