Implement parsing if expressions.

This commit is contained in:
2018-02-20 16:38:02 -08:00
parent 8c8e84b10d
commit e5c2570bac
3 changed files with 85 additions and 2 deletions

View File

@@ -10,12 +10,16 @@ libab_result libab_lexer_init(libab_lexer* lexer) {
const char* words[] = {
".",
"[a-zA-Z][a-zA-Z0-9_]*",
"[0-9]+(\\.[0-9]*)?"
"[0-9]+(\\.[0-9]*)?",
"if",
"else"
};
libab_lexer_token tokens[] = {
TOKEN_CHAR,
TOKEN_ID,
TOKEN_NUM,
TOKEN_KW_IF,
TOKEN_KW_ELSE,
};
const size_t count = sizeof(tokens)/sizeof(libab_lexer_token);