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/include | |
parent | a8bfa841540a13aea75fafcf11fe27688f1ea939 (diff) |
re-do all the syntax because why not
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/token.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/include/token.h b/src/include/token.h index 43d868c..bca00b1 100644 --- a/src/include/token.h +++ b/src/include/token.h @@ -5,31 +5,36 @@ typedef struct TOKEN_STRUC { enum { TOKEN_KEYWORD, // keyword - TOKEN_STR_DELIM, // '"' - TOKEN_STR, // "string" - TOKEN_COMM_DELIM_START, // '[' - TOKEN_COMM, // '[comment]' - TOKEN_COMM_DELIM_END, // ']' - TOKEN_DEFINE_CONST, // '=>' - TOKEN_DEFINE_MUT, // '->' - TOKEN_END, // ';' - TOKEN_LORD, // '(' - TOKEN_RORD, // ')' - TOKEN_DIRECTIVE_DELIM, // '#' + TOKEN_STR_DELIM, // ' + TOKEN_STR, // 'string' + TOKEN_COMM_DELIM, // ` + TOKEN_COMM, // `comment` + TOKEN_EXPR_END, // ; + TOKEN_LGROUP, // ( + TOKEN_RGROUP, // ) + TOKEN_DIRECTIVE_DELIM, // # TOKEN_DIRECTIVE, // #DIRECTIVE; - TOKEN_FN_APPLY, // '.' - TOKEN_LIST_DELIM, // ',' - TOKEN_MODULE_MEMBER_DELIM, // ':' - TOKEN_BLOCK_DELIM_START, // '{' - TOKEN_BLOCK_DELIM_END, // '}' - TOKEN_ANY, // '_' - TOKEN_EOF, // '\0' + TOKEN_FN_APPLY, // . + TOKEN_LIST_DELIM, // , + TOKEN_DEF_ARGS_DELIM, // : + TOKEN_BLOCK_DELIM_START, // { + TOKEN_BLOCK_DELIM_END, // } + TOKEN_NAMESPACE_DELIM, // / + TOKEN_ARRAY_DELIM_START, // [ + TOKEN_ARRAY_DELIM_END, // ] + TOKEN_EOF, // \0 } type; char* value; } token_t; -extern token_t* token_init(int type, char* value); +int char_could_start_keyword(char* character); +int char_could_split_keyword(char* character); + +char TOKEN_DEFNAME_FIRST_CHAR_ALLOWED_CHARS[] = "abcdefghijklmnopqrstuvwxyz_"; // chars that can begin a var name +char TOKEN_DEFNAME_SPLIT_CHAR_ALLOWED_CHARS[] = "1234567890_-"; // chars that can be in the rest of the var name, + // not including the ones already defined to begin + // one. #endif |