Turing-Complete now

This commit is contained in:
vegowotenks 2024-10-02 15:42:06 +02:00
parent 3bf4a73c2e
commit 9dbb9e882c
6 changed files with 405 additions and 30 deletions

View file

@ -96,7 +96,7 @@ static Token _Tokenizer_IdentifierToken(StringView* source)
static Token _Tokenizer_SimpleToken(StringView* source)
{
const char* literal_table[] = { "{", "}", "&", ":", "+", "->", "-", "*", "/", "|", "==", "!=", "<", "<=", ">", ">=", "," };
const char* literal_table[] = { "{", "}", "&", ":", "+", "->", "-", "*", "/", "|", "==", "!=", "<", "<=", ">", ">=", ",", ";" };
const enum TokenType type_table[] = {
TOKENTYPE_LEFT_BRACE,
TOKENTYPE_RIGHT_BRACE,
@ -115,6 +115,7 @@ static Token _Tokenizer_SimpleToken(StringView* source)
TOKENTYPE_GREATERTHAN,
TOKENTYPE_GREATEREQUAL,
TOKENTYPE_COMMA,
TOKENTYPE_SEMICOLON,
};
for (size_t i = 0; i < sizeof(literal_table) / sizeof(literal_table[0]); i++) {
@ -205,5 +206,10 @@ const char* TokenType_ToString(enum TokenType type)
return "TOKENTYPE_GREATEREQUAL";
case TOKENTYPE_COMMA:
return "TOKENTYPE_COMMA";
case TOKENTYPE_SEMICOLON:
return "TOKENTYPE_SEMICOLON";
}
return "INVALID";
}