-
Notifications
You must be signed in to change notification settings - Fork 28
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
Bring Zen language lexical changes #42
Comments
@linux-china I know you was interested in the lexer modifications. Do you have any changes that can help with this problem? |
@anatol yes, you should update grammar files https://github.com/ice1000/intellij-zig/tree/master/grammar and grammar files are some old. @ice1000 |
Here is another example that plugin is unable to parse const std = @import("std");
pub fn Queue(comptime Child: type) type {
return struct {
const This = @This();
const Node = struct {
data: Child,
next: ?*Node,
};
gpa: std.mem.Allocator,
start: ?*Node,
end: ?*Node,
pub fn init(gpa: std.mem.Allocator) This {
return This{
.gpa = gpa,
.start = null,
.end = null,
};
}
pub fn enqueue(this: *This, value: Child) !void {
const node = try this.gpa.create(Node);
node.* = .{ .data = value, .next = null };
if (this.end) |end| end.next = node //
else this.start = node;
this.end = node;
}
pub fn dequeue(this: *This) ?Child {
const start = this.start orelse return null;
defer this.gpa.destroy(start);
if (start.next) |next|
this.start = next
else {
this.start = null;
this.end = null;
}
return start.data;
}
};
} |
Do you have some time to modify the BNF? If you show me very specific code snippets, maybe I can help.... I do not have Java 11 on my computer. I only have Java 19, which does not work with Gradle 7.5.1. The oldest version of Gradle that is compatible with running on Java 19 is some nightly version of Gradle 7.6, unfortunately. |
@ice1000 BNF and grammar-kit are still hard for most developers. If you can finish BNF for Zig, and it's good for plugin contributors. |
I mean I don't have the time to check all the grammar differences. It's too much. I know grammar-kit but I don't want to spend time on zig (for now) anymore. Grammar-Kit is very easy, compared to implementing stub indices for psi elements. Not to mention type inference. |
I'm a college student with several part time jobs at the same time. I really really really want 114514 hours every single day. |
I do not have any experience with BNF. So I ask somebody with one to help bring the lexer up to date. Is there any official lex file for zig language? Where is the language syntax specification? |
Thanks! If only zig has a spec like that when I first developed the plugin 😢 |
I made a fix for the first problem. |
Zed is actively evolving, and this plugin should catch up with it.
This ticket is to track this activity.
Here is an example that is not properly parsed by plugin:
This part
(.{}){};
is reported as<expr> or RIGHT_PAREN expected, got '.'
The text was updated successfully, but these errors were encountered: