Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
KhairallahA committed Oct 9, 2024
1 parent edbb2a7 commit bc1611e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/script/cond_stack.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const testing = std.testing;
pub const ConditionalStackError = error{
StackUnderflow,
OutOfMemory,
InvalidValue,
};

pub const ConditionalValues = enum(u8) {
Expand Down Expand Up @@ -44,6 +43,9 @@ pub const ConditionalStack = struct {

/// Delete an item from the stack
pub fn delete(self: *ConditionalStack) ConditionalStackError!void {
if (self.stack.items.len == 0) {
return ConditionalStackError.OutOfMemory;
}
self.stack.items.len -= 1;
}

Expand Down

0 comments on commit bc1611e

Please sign in to comment.