From 8e142cd9e0f5a05c36025624e6c4897951f3e775 Mon Sep 17 00:00:00 2001 From: kdx Date: Sun, 22 Jan 2023 05:36:05 +0100 Subject: lexer todolist --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- Token.c | 1 - Token.h | 1 - lexer.c | 1 - 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9e20dd9..29a6b52 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,55 @@ It's sheer simplicity makes it easily expandable. I fucking wanted to make it. -## When? - -I don't know, I progress on GOLEM to procrastinate on important work so -probably soon lol +## Project state + +`[ ]` lexer +* `[x]` word +* `[x]` decimal litteral +* `[ ]` hexadecimal litteral +* `[ ]` binary litteral +* `[ ]` char litteral +* `[x]` string litteral +* `[x]` `var` +* `[x]` `const` +* `[x]` `fn` +* `[ ]` `if` +* `[ ]` `else` +* `[ ]` `while` +* `[x]` `(` +* `[x]` `)` +* `[x]` `{` +* `[x]` `}` +* `[x]` `[` +* `[x]` `]` +* `[x]` `:` +* `[x]` `;` +* `[x]` `=` +* `[ ]` `+=` +* `[ ]` `-=` +* `[ ]` `*=` +* `[ ]` `/=` +* `[ ]` `%=` +* `[ ]` `&=` +* `[ ]` `|=` +* `[ ]` `^=` +* `[ ]` `+` +* `[ ]` `-` +* `[ ]` `*` +* `[ ]` `/` +* `[ ]` `%` +* `[ ]` `&` +* `[ ]` `|` +* `[ ]` `^` +* `[ ]` `~` +* `[ ]` `$` +* `[ ]` `!` +* `[x]` `==` +* `[x]` `!=` +* `[x]` `<` +* `[ ]` `>` +* `[ ]` `<=` +* `[ ]` `>=` +* `[ ]` `||` +* `[ ]` `&&` +* `[x]` `//` diff --git a/Token.c b/Token.c index 3d273a2..a406332 100644 --- a/Token.c +++ b/Token.c @@ -40,7 +40,6 @@ const char *token_type_str(unsigned int type) case TOK_COMP_LESS: return "TOK_COMP_LESS"; case TOK_MODULO: return "TOK_MODULO"; case TOK_STAR: return "TOK_STAR"; - case TOK_INCREMENT: return "TOK_INCREMENT"; case TOK_COMP_EQ: return "TOK_COMP_EQ"; case TOK_COMP_NEQ: return "TOK_COMP_NEQ"; case TOK_KW_CONST: return "TOK_KW_CONST"; diff --git a/Token.h b/Token.h index 7b4aa20..1767829 100644 --- a/Token.h +++ b/Token.h @@ -21,7 +21,6 @@ enum { TOK_MODULO, TOK_STAR, /* double char toks */ - TOK_INCREMENT, TOK_COMP_EQ, TOK_COMP_NEQ, TOK_COMMENT, diff --git a/lexer.c b/lexer.c index dd97785..e45f949 100644 --- a/lexer.c +++ b/lexer.c @@ -40,7 +40,6 @@ static unsigned int one_wide_tok(const char *s) static unsigned int two_wide_tok(const char *s) { switch (PAIR(s[0], s[1])) { - case PAIR('+', '+'): return TOK_INCREMENT; case PAIR('=', '='): return TOK_COMP_EQ; case PAIR('!', '='): return TOK_COMP_NEQ; case PAIR('/', '/'): return TOK_COMMENT; -- cgit v1.2.3