예제 #1
0
// compiles and runs bytecode
struct variable *sys_interpret(struct context *context)
{
    struct variable *value = (struct variable*)stack_pop(context->operand_stack);
    struct variable *script = (struct variable*)array_get(value->list.ordered, 1);
    interpret_string(context, script->str);
    return NULL;
}
예제 #2
0
파일: interpret.c 프로젝트: ys1382/filagree
// run a script, using the same context
struct context *interpret_string_with(struct context *context, struct byte_array *script) {
    if (NULL == context) {
        context = context_new(NULL, true, true);
    }

    interpret_string(context, script);
    return context;
}
예제 #3
0
파일: interpret.c 프로젝트: ys1382/filagree
// run a file, using the same context
struct context *interpret_file_with(struct context *context, struct byte_array *path) {
    if (NULL == context) {
        context = context_new(NULL, true, true);
    }

    struct byte_array *script = read_file(path, 0, 0);
    assert_message(NULL != script, "file not found: %s\n", byte_array_to_string(path));
    interpret_string(context, script);
    return context;
}