Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zig] Parser: Add support for basic import exposes #7673

Merged
merged 5 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This table provides a summary of progress for the zig compiler re-write and shou

| | Str & Num * | Functions | Modules | Collections | Records & Tuples | Recursive Types | Static Dispatch |
|--------------------------|:-----------:|:----------:|:-------:|:-----------:|:-----------------:|:----------------:|:----------------:|
| **Parse** | 🚧 | 🚧 | | | | | |
| **Parse** | 🪫 | 🪫 | 🚧 | 🪫 | 🪫 | 🪫 | 🪫 |
| **Canonicalize** | 🚧 | 🚧 | | | | | |
| **Resolve Imports** | | | | | | | |
| **Check Types** | | | | | | | |
Expand Down
8 changes: 7 additions & 1 deletion src/check/parse.zig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ fn testSExprHelper(source: []const u8, expected: []const u8) !void {
// parse our source
var parse_ast = parse(&env, source);
defer parse_ast.deinit();
std.testing.expectEqualSlices(IR.Diagnostic, &[_]IR.Diagnostic{}, parse_ast.errors) catch {
std.debug.print("Tokens:\n{any}", .{parse_ast.tokens.tokens.items(.tag)});
std.debug.panic("Test failed with parse errors", .{});
};

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

const expected =
\\(file
\\ (header 'foo' 'bar')
\\ (header
\\ (exposed_item (lower_ident 'foo'))
\\ (exposed_item (lower_ident 'bar')))
\\ (decl
\\ (ident 'foo')
\\ (string 'hey'))
Expand Down
Loading
Loading