diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-19 16:52:49 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-19 16:52:49 +0100 |
commit | 01498853a2853cd02143391eac28bfc200734dbb (patch) | |
tree | 92c90ef0ab61a7edb9e4fdf712657054a74d18f6 | |
parent | Feature: Add basic support for equality expression (diff) | |
download | interpreter-01498853a2853cd02143391eac28bfc200734dbb.tar.gz interpreter-01498853a2853cd02143391eac28bfc200734dbb.tar.bz2 interpreter-01498853a2853cd02143391eac28bfc200734dbb.zip |
Bug: Fix bug with accept_parse
-rw-r--r-- | src/parser.zig | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |