Compare commits

..

No commits in common. "af2574b7699a51ed3236d476ad9ce1b46b082653" and "22394b2d6e089567910425f4a67a08338658dea4" have entirely different histories.

3 changed files with 6 additions and 23 deletions

View file

@ -3,6 +3,7 @@
- Listen - Listen
- Müllabfuhr - Müllabfuhr
- Innere Funktionsdefinition - Innere Funktionsdefinition
- Semikolon am Ende der Datei
- at Annotations - at Annotations
- Datentypen - Datentypen
- Kommentare - Kommentare
@ -14,6 +15,3 @@
## builtins ## builtins
- I/O (print, readline, read\*, write\*) - I/O (print, readline, read\*, write\*)
- always, never, otherwise - always, never, otherwise
## done
- Semikolon am Ende der Datei

View file

@ -96,7 +96,7 @@ static Token _Tokenizer_IdentifierToken(StringView* source)
static Token _Tokenizer_SimpleToken(StringView* source) static Token _Tokenizer_SimpleToken(StringView* source)
{ {
const char* literal_table[] = { "{", "}", "&", ":", "+", "->", "-", "*", "/", "|", "==", "!=", "<", "<=", ">", ">=", ",", ";", "bind", "as", "(", ")" }; const char* literal_table[] = { "{", "}", "&", ":", "+", "->", "-", "*", "/", "|", "==", "!=", "<", "<=", ">", ">=", ",", ";" };
const enum TokenType type_table[] = { const enum TokenType type_table[] = {
TOKENTYPE_LEFT_BRACE, TOKENTYPE_LEFT_BRACE,
TOKENTYPE_RIGHT_BRACE, TOKENTYPE_RIGHT_BRACE,
@ -116,10 +116,6 @@ static Token _Tokenizer_SimpleToken(StringView* source)
TOKENTYPE_GREATEREQUAL, TOKENTYPE_GREATEREQUAL,
TOKENTYPE_COMMA, TOKENTYPE_COMMA,
TOKENTYPE_SEMICOLON, TOKENTYPE_SEMICOLON,
TOKENTYPE_BIND,
TOKENTYPE_AS,
TOKENTYPE_LEFT_PAREN,
TOKENTYPE_RIGHT_PAREN,
}; };
for (size_t i = 0; i < sizeof(literal_table) / sizeof(literal_table[0]); i++) { for (size_t i = 0; i < sizeof(literal_table) / sizeof(literal_table[0]); i++) {
@ -212,15 +208,8 @@ const char* TokenType_ToString(enum TokenType type)
return "TOKENTYPE_COMMA"; return "TOKENTYPE_COMMA";
case TOKENTYPE_SEMICOLON: case TOKENTYPE_SEMICOLON:
return "TOKENTYPE_SEMICOLON"; return "TOKENTYPE_SEMICOLON";
case TOKENTYPE_BIND:
return "BIND";
case TOKENTYPE_AS:
return "AS";
case TOKENTYPE_LEFT_PAREN:
return "LEFT_PAREN";
case TOKENTYPE_RIGHT_PAREN:
return "RIGHT_PAREN";
}
return "INVALID"; }
return "INVALID";
} }

View file

@ -27,10 +27,6 @@ enum TokenType {
TOKENTYPE_GREATERTHAN, TOKENTYPE_GREATERTHAN,
TOKENTYPE_GREATEREQUAL, TOKENTYPE_GREATEREQUAL,
TOKENTYPE_COMMA, TOKENTYPE_COMMA,
TOKENTYPE_BIND,
TOKENTYPE_AS,
TOKENTYPE_LEFT_PAREN,
TOKENTYPE_RIGHT_PAREN,
TOKENTYPE_ERROR, TOKENTYPE_ERROR,
}; };