Skip to content

Commit

Permalink
del todos
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Dec 10, 2023
1 parent bb24305 commit 2cf5a74
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ static bool is_keyword(const char *s)
// - self-hosted compiler
// - syntax documentation
"import", "def", "declare", "class", "union", "enum", "global",
"return", "if", "elif", "else", "while", "for", "pass", "break", "continue",
"True", "False", "None", "NULL", "void", "noreturn",
"and", "or", "not", "self", "as", "sizeof", "assert",
"return", "if", "elif", "else", "while", "for", "break", "continue",
"True", "False", "NULL", "self",
"and", "or", "not", "as", "sizeof", "assert", "pass",
"void", "noreturn",
"bool", "byte", "short", "int", "long", "float", "double",
};
for (const char **kw = &keywords[0]; kw < &keywords[sizeof(keywords)/sizeof(keywords[0])]; kw++)
Expand Down Expand Up @@ -295,7 +296,6 @@ static char *read_string(struct State *st, char quote, int *len)
case '\n':
// \ at end of line, string continues on next line
if (quote == '\'') {
// TODO: tests
st->location.lineno--; // to get error at the correct line number
goto missing_end_quote;
}
Expand All @@ -321,7 +321,6 @@ static char *read_string(struct State *st, char quote, int *len)
return result.ptr;

missing_end_quote:
// TODO: tests
if (quote == '"')
fail_with_error(st->location, "missing \" to end the string");
else
Expand Down

0 comments on commit 2cf5a74

Please sign in to comment.