Skip to content

Commit

Permalink
Update for latest Zig
Browse files Browse the repository at this point in the history
  • Loading branch information
squeek502 authored and Vexu committed Aug 6, 2024
1 parent 399ac84 commit 544ba7a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/aro/Preprocessor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,13 @@ fn clearBuffers(pp: *Preprocessor) void {

pub fn expansionSlice(pp: *Preprocessor, tok: Tree.TokenIndex) []Source.Location {
const S = struct {
fn order_token_index(context: void, lhs: Tree.TokenIndex, rhs: Tree.TokenIndex) std.math.Order {
_ = context;
return std.math.order(lhs, rhs);
fn order_token_index(context: Tree.TokenIndex, item: Tree.TokenIndex) std.math.Order {
return std.math.order(item, context);
}
};

const indices = pp.expansion_entries.items(.idx);
const idx = std.sort.binarySearch(Tree.TokenIndex, tok, indices, {}, S.order_token_index) orelse return &.{};
const idx = std.sort.binarySearch(Tree.TokenIndex, indices, tok, S.order_token_index) orelse return &.{};
const locs = pp.expansion_entries.items(.locs)[idx];
var i: usize = 0;
while (locs[i].id != .unused) : (i += 1) {}
Expand Down

0 comments on commit 544ba7a

Please sign in to comment.