Merge pull request #473 from nektro/zig-10.1679

update to zig master 0.10.0-dev.1679+d227f76af
This commit is contained in:
Auguste Rame 2022-04-01 20:38:54 -04:00 committed by GitHub
commit fd2a863245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -107,7 +107,7 @@ pub fn getFunctionSnippet(allocator: std.mem.Allocator, tree: Ast, func: Ast.ful
const token_tags = tree.tokens.items(.tag);
var it = func.iterate(tree);
var it = func.iterate(&tree);
var i: usize = 0;
while (it.next()) |param| : (i += 1) {
if (skip_self_param and i == 0) continue;
@ -161,7 +161,7 @@ pub fn hasSelfParam(arena: *std.heap.ArenaAllocator, document_store: *DocumentSt
if (func.ast.params.len == 0) return false;
const tree = handle.tree;
var it = func.iterate(tree);
var it = func.iterate(&tree);
const param = it.next().?;
if (param.type_expr == 0) return false;
@ -215,7 +215,7 @@ pub fn isTypeFunction(tree: Ast, func: Ast.full.FnProto) bool {
}
pub fn isGenericFunction(tree: Ast, func: Ast.full.FnProto) bool {
var it = func.iterate(tree);
var it = func.iterate(&tree);
while (it.next()) |param| {
if (param.anytype_ellipsis3 != null or param.comptime_noalias != null) {
return true;
@ -723,7 +723,7 @@ pub fn resolveTypeOfNodeInternal(store: *DocumentStore, arena: *std.heap.ArenaAl
var expected_params = fn_decl.ast.params.len;
// If we call as method, the first parameter should be skipped
// TODO: Back-parse to extract the self argument?
var it = fn_decl.iterate(decl.handle.tree);
var it = fn_decl.iterate(&decl.handle.tree);
if (token_tags[call.ast.lparen - 2] == .period) {
if (try hasSelfParam(arena, store, decl.handle, fn_decl)) {
_ = it.next();
@ -2600,7 +2600,7 @@ fn makeScopeInternal(allocator: std.mem.Allocator, context: ScopeContext, node_i
var scope_idx = scopes.items.len - 1;
errdefer scopes.items[scope_idx].decls.deinit();
var it = func.iterate(tree);
var it = func.iterate(&tree);
while (it.next()) |param| {
// Add parameter decls
if (param.name_token) |name_token| {

View File

@ -146,7 +146,7 @@ fn symbolReferencesInternal(arena: *std.heap.ArenaAllocator, store: *DocumentSto
=> {
var buf: [1]Ast.Node.Index = undefined;
const fn_proto = ast.fnProto(tree, node, &buf).?;
var it = fn_proto.iterate(tree);
var it = fn_proto.iterate(&tree);
while (it.next()) |param| {
if (param.type_expr != 0)
try symbolReferencesInternal(arena, store, .{ .node = param.type_expr, .handle = handle }, decl, encoding, context, handler);
@ -547,7 +547,7 @@ pub fn symbolReferences(arena: *std.heap.ArenaAllocator, store: *DocumentStore,
.function => |proto| {
var buf: [1]Ast.Node.Index = undefined;
const fn_proto = ast.fnProto(curr_handle.tree, proto, &buf).?;
var it = fn_proto.iterate(curr_handle.tree);
var it = fn_proto.iterate(&curr_handle.tree);
while (it.next()) |candidate| {
if (std.meta.eql(candidate, param)) {
if (curr_handle.tree.nodes.items(.tag)[proto] == .fn_decl) {

View File

@ -475,7 +475,7 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D
try writeTokenMod(builder, fn_proto.name_token, func_name_tok_type, tok_mod);
var it = fn_proto.iterate(tree);
var it = fn_proto.iterate(&tree);
while (it.next()) |param_decl| {
if (param_decl.first_doc_comment) |docs| try writeDocComments(builder, tree, docs);

View File

@ -23,7 +23,7 @@ fn fnProtoToSignatureInfo(document_store: *DocumentStore, arena: *std.heap.Arena
} else commas;
var params = std.ArrayListUnmanaged(ParameterInformation){};
var param_it = proto.iterate(tree);
var param_it = proto.iterate(&tree);
while (param_it.next()) |param| {
const param_comments = if (param.first_doc_comment) |dc|
try analysis.collectDocComments(alloc, tree, dc, .Markdown, false)