File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 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-
9999const std = @import ("std" );
100100const _ast = @import ("ast.zig" );
101101const util = @import ("util" );
Original file line number Diff line number Diff line change 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
55symbol : Symbol.Id.Optional ,
66scope : Scope.Id ,
Original file line number Diff line number Diff line change 1+ const Scope = @This ();
2+
13/// Unique identifier for this scope.
24id : Id ,
35/// Scope hints.
@@ -162,8 +164,6 @@ const ScopeParentIterator = struct {
162164 }
163165};
164166
165- const Scope = @This ();
166-
167167const std = @import ("std" );
168168const util = @import ("util" );
169169const _ast = @import ("ast.zig" );
Original file line number Diff line number Diff line change 1313//! an entire linked binary or library; rather it refers to a single parsed
1414//! file.
1515
16+ const Semantic = @This ();
17+
1618parse : Parse , // NOTE: allocated in _arena
1719symbols : Symbol.Table = .{},
1820scopes : Scope.Tree = .{},
1921modules : 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-
135135const std = @import ("std" );
136136const Allocator = std .mem .Allocator ;
137137const ArenaAllocator = std .heap .ArenaAllocator ;
Original file line number Diff line number Diff line change 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-
335335const std = @import ("std" );
336336const util = @import ("util" );
337337const ast = @import ("ast.zig" );
You can’t perform that action at this time.
0 commit comments