A minimalistic programming language written in C89.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

29 行
617 B

#include "ink.h"
#include <stdio.h>
int main(int argc, char** argv) {
char read_buffer[2048];
struct context* ctx = ink_make_default_context();
char** end_argv = argv + argc;
for(argv+=1; argv != end_argv; argv++) {
FILE* file = fopen(*argv, "r");
size_t cnt = fread(read_buffer, 1, 2047, file);
if(cnt == 0) {
}
read_buffer[cnt] = 0;
ink_compile(ctx, read_buffer);
if(ctx->panic) {
fprintf(stderr, "Panicked !! -> %d\n", ctx->panic);
}
fclose(file);
}
while(ink_can_run(ctx)) {
ink_step_everyone(ctx);
}
printf("\nExecuted in %u steps\n", ctx->steps);
return ctx->panic;
}