Add basic package support (no IR support yet)

This commit is contained in:
gingerBill
2018-05-26 23:12:55 +01:00
parent 5b6770f3d2
commit c067b90403
20 changed files with 698 additions and 818 deletions

View File

@@ -448,12 +448,9 @@ void advance_to_next_rune(Tokenizer *t) {
TokenizerInitError init_tokenizer(Tokenizer *t, String fullpath) {
TokenizerInitError err = TokenizerInit_None;
char *c_str = gb_alloc_array(heap_allocator(), char, fullpath.len+1);
char *c_str = alloc_cstring(heap_allocator(), fullpath);
defer (gb_free(heap_allocator(), c_str));
gb_memcopy(c_str, fullpath.text, fullpath.len);
c_str[fullpath.len] = '\0';
// TODO(bill): Memory map rather than copy contents
gbFileContents fc = gb_file_read_contents(heap_allocator(), true, c_str);
gb_zero_item(t);