Ruby: prism/util/pm_state_stack.c Source File

Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0)

pm_state_stack.c
1#include "prism/util/pm_state_stack.h"
2
6void
7pm_state_stack_push(pm_state_stack_t *stack, bool value) {
8 *stack = (*stack << 1) | (value & 1);
9}
10
14void
15pm_state_stack_pop(pm_state_stack_t *stack) {
16 *stack >>= 1;
17}
18
22bool
23pm_state_stack_p(pm_state_stack_t *stack) {
24 return *stack & 1;
25}
pm_state_stack.h
A stack of boolean values.
pm_state_stack_t
uint32_t pm_state_stack_t
A struct that represents a stack of boolean values.
Definition pm_state_stack.h:17