Skip to content

Commit

Permalink
fix bug in id under loop detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoff-it committed Sep 6, 2024
1 parent 689c84f commit 3edb672
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -821,11 +821,9 @@ const Parser = struct {
// $loop.first)
if (node.idAttr()) |id| blk: {
const value = id.value orelse break :blk;
if (std.mem.startsWith(
u8,
"$",
value.span.slice(p.src),
)) break :blk;
if (std.mem.startsWith(u8, value.span.slice(p.src), "$")) {
break :blk;
}

var upper = ast.parent(node);
while (upper.kind != .root) : (upper = ast.parent(upper)) {
Expand Down

0 comments on commit 3edb672

Please sign in to comment.