From 01498853a2853cd02143391eac28bfc200734dbb Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 19 Jan 2025 16:52:49 +0100 Subject: Bug: Fix bug with accept_parse --- src/parser.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.zig b/src/parser.zig index 1014ba4..f87c406 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -377,12 +377,14 @@ pub const Parser = struct { fn accept_parse(self: *Parser, parsing_func: *const fn (_: *Parser) ParserError!*Node) ?*Node { const prev_offset = self.offset; + const prev_try_context = self.try_context; self.try_context = true; const node = parsing_func(self) catch { self.offset = prev_offset; + self.try_context = prev_try_context; return null; }; - self.try_context = false; + self.try_context = prev_try_context; return node; } -- cgit 1.4.1