예제 #1
0
파일: loops.cpp 프로젝트: andyfischer/circa
Term* loop_find_done_call(Block* block)
{
    for (int i=0; i < block->length(); i++) {
        Term* term = block->get(i);
        Value* methodName = term->getProp(s_method_name);
        if (methodName && string_equals(methodName, "done"))
            return term;
    }
    return NULL;
}
예제 #2
0
파일: loops.cpp 프로젝트: andyfischer/circa
Term* loop_find_iterator_advance(Block* block)
{
    Term* iterator = loop_find_iterator(block);
    for (int i=0; i < block->length(); i++) {
        Term* term = block->get(i);
        if (term->input(0) != iterator)
            continue;
        Value* methodName = term->getProp(s_method_name);
        if (methodName && string_equals(methodName, "advance"))
            return term;
    }
    return NULL;
}