-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Explore modifying Zig's parser to fit the needs of a language server #1536
base: master
Are you sure you want to change the base?
Conversation
Would you consider to try and upstream these changes? I think these changes quite different from a PR like ziglang/zig#14391 where a feature that only gets used by third party projects is being added. |
// Test for `fnCall(.{.})` and `fnCall(Parser.Node{. .some})` because they are handled in different places
// Test for completions after `.{` and every `,`
pub fn gamma(p: Parser) void {
return p.addNode(.{
.tag = 1,
.main_token = 1,
.data = .{
.lhs = undefined,
.rhs = p.addNode(Parser.Node{
.tag,
}),
},
});
}
const Parser = struct {
const Node = struct {
tag: u32,
main_token: u32,
data: struct {
lhs: u32,
rhs: u32,
},
};
pub fn addNode(_: Node) u32 {}
};
fn foo(e: Enum) void {
switch (e) {}
}
const Enum = enum {
foo,
bar,
baz,
}; |
bb0c315
to
fdac742
Compare
3834407
to
65b0d69
Compare
e99a934
to
cf3aed6
Compare
Upkeep's been quite light, the only change being ziglang/zig@f258a39 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1536 +/- ##
=======================================
Coverage 78.45% 78.45%
=======================================
Files 35 35
Lines 10549 10552 +3
=======================================
+ Hits 8276 8279 +3
Misses 2273 2273 ☔ View full report in Codecov by Sentry. |
6dc707d
to
f06b587
Compare
0f92c2b
to
ca60277
Compare
Isn't only the |
The intention is to keep it (close to) a carbon copy as it makes it easy to update by just overwriting a/the file(s) and looking at the overlapping sections. |
6261c74
to
f6bdfc6
Compare
Feeling out how disruptive this would be
Ignoring missing semicolons (https://github.com/ziglang/zig/blob/eb5276c94eaab238551fdae9a2e77b0133e31cfb/lib/std/zig/Parse.zig#L876) solves
Haven't observed any side effects and the number and type of errors is the same.
Somewhat of a changelog
fixes #1112
fixes #1525
fixes #1535
fixes #1549