Skip to content

Commit

Permalink
Merge pull request #473 from nektro/zig-10.1679
Browse files Browse the repository at this point in the history
update to zig master 0.10.0-dev.1679+d227f76af
  • Loading branch information
SuperAuguste authored Apr 2, 2022
2 parents 14698c3 + ca40994 commit fd2a863
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/analysis.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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| {
Expand Down
4 changes: 2 additions & 2 deletions src/references.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/semantic_tokens.zig
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const Builder = struct {
{}
continue;
}

if (source[i] != '/' or source[i + 1] != '/')
continue;

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/signature_help.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fd2a863

Please sign in to comment.