Fixed error union decls

This commit is contained in:
Alexandros Naskos 2020-06-11 11:21:08 +03:00
parent 693e810d75
commit be9f2de43a

View File

@ -165,6 +165,10 @@ pub fn getDeclNameToken(tree: *ast.Tree, node: *ast.Node) ?ast.TokenIndex {
const field = node.cast(ast.Node.ContainerField).?; const field = node.cast(ast.Node.ContainerField).?;
return field.name_token; return field.name_token;
}, },
.ErrorTag => {
const tag = node.cast(ast.Node.ErrorTag).?;
return tag.name_token;
},
// We need identifier for captures and error set tags // We need identifier for captures and error set tags
.Identifier => { .Identifier => {
const ident = node.cast(ast.Node.Identifier).?; const ident = node.cast(ast.Node.Identifier).?;
@ -1291,7 +1295,7 @@ fn makeScopeInternal(
.tests = &[0]*ast.Node{}, .tests = &[0]*ast.Node{},
.data = .{ .container = node }, .data = .{ .container = node },
}; };
var scope_idx = scopes.items.len - 1; const scope_idx = scopes.items.len - 1;
var uses = std.ArrayList(*ast.Node.Use).init(allocator); var uses = std.ArrayList(*ast.Node.Use).init(allocator);
var tests = std.ArrayList(*ast.Node).init(allocator); var tests = std.ArrayList(*ast.Node).init(allocator);