aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-03-23 23:13:01 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-03-23 23:13:01 -0700
commita1afe693951f6d2ad06961c06b3a2cc14ad6efd9 (patch)
treec26d5a6ee62e7b5bd59d13e0db549a945077aca4 /src/Module.zig
parent13ced07f23311bef859d07cdd25e0e4fa95ab76a (diff)
downloadzig-a1afe693951f6d2ad06961c06b3a2cc14ad6efd9.tar.gz
zig-a1afe693951f6d2ad06961c06b3a2cc14ad6efd9.zip
stage2: comment out failing test cases; implement more things
* comment out the failing stage2 test cases (so that we can uncomment the ones that are newly passing with further commits) * Sema: implement negate, negatewrap * astgen: implement field access, multiline string literals, and character literals * Module: when resolving an AST node into a byte offset, use the main_tokens array, not the firstToken function
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 88595bc80d..fdf8267017 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -1535,7 +1535,8 @@ pub const SrcLoc = struct {
const decl = src_loc.container.decl;
const node_index = decl.relativeToNodeIndex(node_off);
const tree = decl.container.file_scope.base.tree();
- const tok_index = tree.firstToken(node_index);
+ const main_tokens = tree.nodes.items(.main_token);
+ const tok_index = main_tokens[node_index];
const token_starts = tree.tokens.items(.start);
return token_starts[tok_index];
},