From a1afe693951f6d2ad06961c06b3a2cc14ad6efd9 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 23 Mar 2021 23:13:01 -0700 Subject: 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 --- src/Module.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Module.zig') 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]; }, -- cgit v1.2.3