Skip to content

Commit edad3c7

Browse files
committed
[zig] Parser: Exposed items for imports/headers
1 parent ea336d3 commit edad3c7

File tree

5 files changed

+432
-86
lines changed

5 files changed

+432
-86
lines changed

src/check/parse.zig

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ fn testSExprHelper(source: []const u8, expected: []const u8) !void {
100100
// parse our source
101101
var parse_ast = parse(&env, source);
102102
defer parse_ast.deinit();
103+
std.testing.expectEqualSlices(IR.Diagnostic, &[_]IR.Diagnostic{}, parse_ast.errors) catch {
104+
std.debug.print("Tokens:\n{any}", .{parse_ast.tokens.tokens.items(.tag)});
105+
std.debug.panic("Test failed with parse errors", .{});
106+
};
103107

104108
// shouldn't be required in future
105109
parse_ast.store.emptyScratch();
@@ -126,7 +130,9 @@ test "example s-expr" {
126130

127131
const expected =
128132
\\(file
129-
\\ (header 'foo' 'bar')
133+
\\ (header
134+
\\ (exposed_item (lower_ident 'foo'))
135+
\\ (exposed_item (lower_ident 'bar')))
130136
\\ (decl
131137
\\ (ident 'foo')
132138
\\ (string 'hey'))

0 commit comments

Comments
 (0)