| ... | ... | @@ -2186,14 +2186,14 @@ pub const SrcLoc = struct { |
| 2186 | 2186 | return token_starts[src_loc.declSrcToken()] + byte_off; |
| 2187 | 2187 | }, |
| 2188 | 2188 | .token_offset => |tok_off| { |
| 2189 | | const tok_index = src_loc.declSrcToken() + tok_off; |
| 2190 | 2189 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2190 | const tok_index = src_loc.declSrcToken() + tok_off; |
| 2191 | 2191 | const token_starts = tree.tokens.items(.start); |
| 2192 | 2192 | return token_starts[tok_index]; |
| 2193 | 2193 | }, |
| 2194 | 2194 | .node_offset, .node_offset_bin_op => |node_off| { |
| 2195 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2196 | 2195 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2196 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2197 | 2197 | assert(src_loc.file_scope.tree_loaded); |
| 2198 | 2198 | const main_tokens = tree.nodes.items(.main_token); |
| 2199 | 2199 | const tok_index = main_tokens[node]; |
| ... | ... | @@ -2201,15 +2201,15 @@ pub const SrcLoc = struct { |
| 2201 | 2201 | return token_starts[tok_index]; |
| 2202 | 2202 | }, |
| 2203 | 2203 | .node_offset_back2tok => |node_off| { |
| 2204 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2205 | 2204 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2205 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2206 | 2206 | const tok_index = tree.firstToken(node) - 2; |
| 2207 | 2207 | const token_starts = tree.tokens.items(.start); |
| 2208 | 2208 | return token_starts[tok_index]; |
| 2209 | 2209 | }, |
| 2210 | 2210 | .node_offset_var_decl_ty => |node_off| { |
| 2211 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2212 | 2211 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2212 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2213 | 2213 | const node_tags = tree.nodes.items(.tag); |
| 2214 | 2214 | const full = switch (node_tags[node]) { |
| 2215 | 2215 | .global_var_decl => tree.globalVarDecl(node), |
| ... | ... | @@ -2362,8 +2362,8 @@ pub const SrcLoc = struct { |
| 2362 | 2362 | }, |
| 2363 | 2363 | |
| 2364 | 2364 | .node_offset_for_cond, .node_offset_if_cond => |node_off| { |
| 2365 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2366 | 2365 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2366 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2367 | 2367 | const node_tags = tree.nodes.items(.tag); |
| 2368 | 2368 | const src_node = switch (node_tags[node]) { |
| 2369 | 2369 | .if_simple => tree.ifSimple(node).ast.cond_expr, |
| ... | ... | @@ -2381,8 +2381,8 @@ pub const SrcLoc = struct { |
| 2381 | 2381 | return token_starts[tok_index]; |
| 2382 | 2382 | }, |
| 2383 | 2383 | .node_offset_bin_lhs => |node_off| { |
| 2384 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2385 | 2384 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2385 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2386 | 2386 | const node_datas = tree.nodes.items(.data); |
| 2387 | 2387 | const src_node = node_datas[node].lhs; |
| 2388 | 2388 | const main_tokens = tree.nodes.items(.main_token); |
| ... | ... | @@ -2391,8 +2391,8 @@ pub const SrcLoc = struct { |
| 2391 | 2391 | return token_starts[tok_index]; |
| 2392 | 2392 | }, |
| 2393 | 2393 | .node_offset_bin_rhs => |node_off| { |
| 2394 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2395 | 2394 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2395 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2396 | 2396 | const node_datas = tree.nodes.items(.data); |
| 2397 | 2397 | const src_node = node_datas[node].rhs; |
| 2398 | 2398 | const main_tokens = tree.nodes.items(.main_token); |
| ... | ... | @@ -2402,8 +2402,8 @@ pub const SrcLoc = struct { |
| 2402 | 2402 | }, |
| 2403 | 2403 | |
| 2404 | 2404 | .node_offset_switch_operand => |node_off| { |
| 2405 | | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2406 | 2405 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2406 | const node = src_loc.declRelativeToNodeIndex(node_off); |
| 2407 | 2407 | const node_datas = tree.nodes.items(.data); |
| 2408 | 2408 | const src_node = node_datas[node].lhs; |
| 2409 | 2409 | const main_tokens = tree.nodes.items(.main_token); |
| ... | ... | @@ -2413,8 +2413,8 @@ pub const SrcLoc = struct { |
| 2413 | 2413 | }, |
| 2414 | 2414 | |
| 2415 | 2415 | .node_offset_switch_special_prong => |node_off| { |
| 2416 | | const switch_node = src_loc.declRelativeToNodeIndex(node_off); |
| 2417 | 2416 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2417 | const switch_node = src_loc.declRelativeToNodeIndex(node_off); |
| 2418 | 2418 | const node_datas = tree.nodes.items(.data); |
| 2419 | 2419 | const node_tags = tree.nodes.items(.tag); |
| 2420 | 2420 | const main_tokens = tree.nodes.items(.main_token); |
| ... | ... | @@ -2439,8 +2439,8 @@ pub const SrcLoc = struct { |
| 2439 | 2439 | }, |
| 2440 | 2440 | |
| 2441 | 2441 | .node_offset_switch_range => |node_off| { |
| 2442 | | const switch_node = src_loc.declRelativeToNodeIndex(node_off); |
| 2443 | 2442 | const tree = try src_loc.file_scope.getTree(gpa); |
| 2443 | const switch_node = src_loc.declRelativeToNodeIndex(node_off); |
| 2444 | 2444 | const node_datas = tree.nodes.items(.data); |
| 2445 | 2445 | const node_tags = tree.nodes.items(.tag); |
| 2446 | 2446 | const main_tokens = tree.nodes.items(.main_token); |