From 3edb67236291d45ba97a79cdac3b91692487a352 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Fri, 6 Sep 2024 17:36:31 +0200 Subject: [PATCH] fix bug in id under loop detection --- src/Ast.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Ast.zig b/src/Ast.zig index 122b30d..6cb6f7d 100644 --- a/src/Ast.zig +++ b/src/Ast.zig @@ -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)) {