aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-18 21:44:22 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-18 21:44:22 +0100
commit828095afd1351b218cae6b60033200a92894921c (patch)
treeeca72ccef9a122f809cc824d47989ad03077b833 /src/tokenizer.cpp
parent2d6171f3e573c06dc9eb1c8fc3ada720998b24fa (diff)
Better name mangler for SSA generation
TODO: Define better name mangling rules and allow for explicit name overload
Diffstat (limited to 'src/tokenizer.cpp')
-rw-r--r--src/tokenizer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp
index 6f645b7a6..6c3604406 100644
--- a/src/tokenizer.cpp
+++ b/src/tokenizer.cpp
@@ -210,6 +210,17 @@ void syntax_error(Token token, char *fmt, ...) {
}
+void compiler_error(char *fmt, ...) {
+ va_list va;
+
+ va_start(va, fmt);
+ gb_printf_err("Internal Compiler Error: %s\n",
+ gb_bprintf_va(fmt, va));
+ va_end(va);
+ gb_exit(1);
+}
+
+
// NOTE(bill): result == priority
i32 token_precedence(Token t) {
@@ -354,6 +365,7 @@ TokenizerInitError init_tokenizer(Tokenizer *t, String fullpath) {
defer (gb_free(gb_heap_allocator(), c_str));
+
gbFileContents fc = gb_file_read_contents(gb_heap_allocator(), true, c_str);
gb_zero_item(t);
if (fc.data != NULL) {