-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request
Description
Started looking into a PR for the update, but it will require some big and breaking changes, so i wanted to raise the issue first for discussion.
TODO list:
- Update dependencies: Sent PRs to both
chameleonandsmart-pointers,recoveris already updated upstream - Removal of
usingnamespace. This breaks theBitflags"hack" mixin. I can think of 2 alternatives:
// A: "wrapper" around the input type
const Bitflags = @import("util.zig").Bitflags;
const Flags = Bitflags(packed struct {
flag: bool
...
});
// creation
const f: Flags = .{ .flag = true }; // old
const f: Flags = .from(.{ .flag = true }); // new
// operations
f.contains(f); // remains as is
// reads
if (f.flag) // old
if (f.inner.flag) // new
// integrates nicely with .format and .jsonStringify
// B: namespace providing operations
const operations = @import("util.zig").Bitflags; // renamed import for readability
const Flags = packed struct {
flag: bool
...
};
// creation
const f: Flags = .{ .flag = true }; // remains as is
// operations
f.contains(f); // old
operations(Flags).contains(a, b); // new
// reads
if (f.flag) // remains as is
// extra work for .format and .jsonStringify
const T = struct {
...
const ops = operations(@This());
const format = ops.format;
const jsonStringify = ops.jsonStringify;
};- Changes to
NodetypesIndexis now a different type (enum (usize) { _ }), there's alsoOptionalIndex. Most places just need a call to@intFromEnum, others would need some triaging (eg: avoiding the@compileErrorinsideWalker.pushFullNode, because index no longer falls into theu32branch)Dataisn'tstruct { lhs: Index, rhs: Index }anymore, it is an untagged union, where the variant to be read is defined by checking the node's tag. This is likely the biggest change. Would probably involve:- Removing
NodeDataKindand instead handle each specificNode.Tagon a bigswitch - Adding something like
get{L,R}hs(node: Node) Nodetoast_utils.zigto access the relevant nodes on each rule's code
- Removing
- Writergate and
ArrayList(now unmanaged): These take a little work but easily doable
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request