aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-31 11:36:00 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-31 11:36:00 +0100
commit0fae31fb545b474359359fd644911fa335c5c282 (patch)
tree5077da92ae70949b014c981d91467d67ff127e2f /src/parser.cpp
parent8987a6630c8ec43da770dd92c10f6b92e17201f2 (diff)
Extra type safety; Fix typos
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 3ae3f767e..b9ff2554c 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -36,7 +36,7 @@ struct ImportedFile {
struct AstFile {
- i32 id;
+ isize id;
gbArena arena;
Tokenizer tokenizer;
Array<Token> tokens;
@@ -1574,7 +1574,7 @@ AstNode *ast_foreign_library_spec(AstFile *f, Token filepath, Token library_name
bool next_token0(AstFile *f) {
- Token prev = f->curr_token;
+ // Token prev = f->curr_token;
if (f->curr_token_index+1 < f->tokens.count) {
f->curr_token = f->tokens[++f->curr_token_index];
return true;
@@ -1675,10 +1675,9 @@ TokenKind look_ahead_token_kind(AstFile *f, isize amount) {
Token expect_token(AstFile *f, TokenKind kind) {
Token prev = f->curr_token;
if (prev.kind != kind) {
+ String c = token_strings[kind];
String p = token_strings[prev.kind];
- syntax_error(f->curr_token, "Expected `%.*s`, got `%.*s`",
- LIT(token_strings[kind]),
- LIT(token_strings[prev.kind]));
+ syntax_error(f->curr_token, "Expected `%.*s`, got `%.*s`", LIT(c), LIT(p));
if (prev.kind == Token_EOF) {
gb_exit(1);
}
@@ -5122,7 +5121,7 @@ ParseFileError parse_files(Parser *p, String init_filename) {
} else if (p->curr_import_index < p->imports.count) {
if (t->return_value != 0) {
for_array(i, worker_threads) {
- gb_thread_destory(&worker_threads[i]);
+ gb_thread_destroy(&worker_threads[i]);
}
return cast(ParseFileError)t->return_value;
}
@@ -5137,7 +5136,7 @@ ParseFileError parse_files(Parser *p, String init_filename) {
}
for_array(i, worker_threads) {
- gb_thread_destory(&worker_threads[i]);
+ gb_thread_destroy(&worker_threads[i]);
}
} else {
for_array(i, p->imports) {