diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-03-26 06:39:28 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-03-26 06:39:28 -0400 |
| commit | 5bc9feb5cb98fc13db62d01b2b9fec15677310a7 (patch) | |
| tree | 12972dfc1f9b964bb74428ec0d6766e77b9b0be7 /src/analyze.cpp | |
| parent | 7ce753a16b0c16b4c6494467f42f2d5fe9a235e6 (diff) | |
| download | zig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.tar.gz zig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.zip | |
organize std and make import relative to current file
closes #216
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 1ba430be15..380e384644 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2874,11 +2874,8 @@ void preview_use_decl(CodeGen *g, AstNode *node) { ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, Buf *abs_full_path, Buf *src_dirname, Buf *src_basename, Buf *source_code) { - Buf *full_path = buf_alloc(); - os_path_join(src_dirname, src_basename, full_path); - if (g->verbose) { - fprintf(stderr, "\nOriginal Source (%s):\n", buf_ptr(full_path)); + fprintf(stderr, "\nOriginal Source (%s):\n", buf_ptr(abs_full_path)); fprintf(stderr, "----------------\n"); fprintf(stderr, "%s\n", buf_ptr(source_code)); @@ -2890,7 +2887,7 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, tokenize(source_code, &tokenization); if (tokenization.err) { - ErrorMsg *err = err_msg_create_with_line(full_path, tokenization.err_line, tokenization.err_column, + ErrorMsg *err = err_msg_create_with_line(abs_full_path, tokenization.err_line, tokenization.err_column, source_code, tokenization.line_offsets, tokenization.err); print_err_msg(err, g->err_color); @@ -2908,7 +2905,7 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package, import_entry->package = package; import_entry->source_code = source_code; import_entry->line_offsets = tokenization.line_offsets; - import_entry->path = full_path; + import_entry->path = abs_full_path; import_entry->root = ast_parse(source_code, tokenization.tokens, import_entry, g->err_color, &g->next_node_index); |
