Skip to content

Commit 5d291e6

Browse files
authored
chore: random cleanup (#286)
1 parent af27ac7 commit 5d291e6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/semantic/NodeLinks.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Links AST nodes to other semantic data
22

3+
const NodeLinks = @This();
4+
35
/// Map of AST nodes to their parents. Index is the child node id.
46
///
57
/// Confusingly, the root node id is also used as the "null" node id, so the
@@ -94,8 +96,6 @@ const ParentIdsIterator = struct {
9496
}
9597
};
9698

97-
const NodeLinks = @This();
98-
9999
const std = @import("std");
100100
const _ast = @import("ast.zig");
101101
const util = @import("util");

src/semantic/Reference.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! A reference on a symbol. Describes where and how a symbol is used.
22

3-
pub const Reference = @This();
3+
const Reference = @This();
44

55
symbol: Symbol.Id.Optional,
66
scope: Scope.Id,

src/semantic/Scope.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const Scope = @This();
2+
13
/// Unique identifier for this scope.
24
id: Id,
35
/// Scope hints.
@@ -162,8 +164,6 @@ const ScopeParentIterator = struct {
162164
}
163165
};
164166

165-
const Scope = @This();
166-
167167
const std = @import("std");
168168
const util = @import("util");
169169
const _ast = @import("ast.zig");

src/semantic/Semantic.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
//! an entire linked binary or library; rather it refers to a single parsed
1414
//! file.
1515

16+
const Semantic = @This();
17+
1618
parse: Parse, // NOTE: allocated in _arena
1719
symbols: Symbol.Table = .{},
1820
scopes: Scope.Tree = .{},
1921
modules: ModuleRecord = .{},
20-
node_links: NodeLinks,
22+
node_links: NodeLinks = .{},
2123
_gpa: Allocator,
2224
/// Used to allocate AST nodes
2325
_arena: ArenaAllocator,
@@ -130,8 +132,6 @@ pub fn deinit(self: *Semantic) void {
130132
self.* = undefined;
131133
}
132134

133-
const Semantic = @This();
134-
135135
const std = @import("std");
136136
const Allocator = std.mem.Allocator;
137137
const ArenaAllocator = std.heap.ArenaAllocator;

src/semantic/Symbol.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//!
33
//! Type: `pub struct Symbol<'a>`
44

5+
const Symbol = @This();
6+
57
/// Identifier bound to this symbol.
68
///
79
///
@@ -330,8 +332,6 @@ pub const ReferenceIterator = struct {
330332
}
331333
};
332334

333-
const Symbol = @This();
334-
335335
const std = @import("std");
336336
const util = @import("util");
337337
const ast = @import("ast.zig");

0 commit comments

Comments
 (0)