Add the ability to parse types.

This ability is not integrated with the rest of the parser - in fact, the grammar for things like function declarations (where type declarations are necessary) is not yet determined.
This commit is contained in:
2018-03-06 16:47:11 -08:00
parent 45d955b8bd
commit 2487cdebe0
4 changed files with 178 additions and 11 deletions

View File

@@ -14,7 +14,8 @@ libab_result libab_lexer_init(libab_lexer* lexer) {
"if",
"else",
"while",
"do"
"do",
"->"
};
libab_lexer_token tokens[] = {
TOKEN_CHAR,
@@ -23,7 +24,8 @@ libab_result libab_lexer_init(libab_lexer* lexer) {
TOKEN_KW_IF,
TOKEN_KW_ELSE,
TOKEN_KW_WHILE,
TOKEN_KW_DO
TOKEN_KW_DO,
TOKEN_KW_ARROW
};
const size_t count = sizeof(tokens)/sizeof(libab_lexer_token);