Sha256: 26c7b122b8ad19fac77cdaf051b9a9e6788519214199b19c218b91bf16cc6236

Contents?: true

Size: 430 Bytes

Versions: 12

Compression:

Stored size: 430 Bytes

Contents

#include "prism/util/pm_state_stack.h"

/**
 * Pushes a value onto the stack.
 */
void
pm_state_stack_push(pm_state_stack_t *stack, bool value) {
    *stack = (*stack << 1) | (value & 1);
}

/**
 * Pops a value off the stack.
 */
void
pm_state_stack_pop(pm_state_stack_t *stack) {
    *stack >>= 1;
}

/**
 * Returns the value at the top of the stack.
 */
bool
pm_state_stack_p(pm_state_stack_t *stack) {
    return *stack & 1;
}

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
prism-0.25.0 src/util/pm_state_stack.c
jruby-prism-parser-0.24.0-java src/util/pm_state_stack.c
jruby-prism-parser-0.23.0.pre.SNAPSHOT-java src/util/pm_state_stack.c
prism-0.24.0 src/util/pm_state_stack.c
prism-0.23.0 src/util/pm_state_stack.c
prism-0.22.0 src/util/pm_state_stack.c
prism-0.21.0 src/util/pm_state_stack.c
prism-0.20.0 src/util/pm_state_stack.c
prism-0.19.0 src/util/pm_state_stack.c
prism-0.18.0 src/util/pm_state_stack.c
prism-0.17.1 src/util/pm_state_stack.c
prism-0.17.0 src/util/pm_state_stack.c