예제 #1
0
void Block__list_configs(VM* vm)
{
    Block* block = as_block(vm->input(0));
    if (block == NULL)
        return vm->throw_str("NULL block");

    Value* output = vm->output();

    for (int i=0; i < block->length(); i++) {
        Term* term = block->get(i);
        if (is_considered_config(term))
            set_term_ref(circa_append(output), term);
    }
}
예제 #2
0
void Branch__list_configs(caStack* stack)
{
    Branch* branch = as_branch(circa_input(stack, 0));
    if (branch == NULL)
        return circa_output_error(stack, "NULL branch");

    caValue* output = circa_output(stack, 0);

    for (int i=0; i < branch->length(); i++) {
        Term* term = branch->get(i);
        if (is_considered_config(term))
            set_term_ref(circa_append(output), term);
    }
}