main.c 740 B

1234567891011121314151617181920212223242526272829303132
  1. #include "__virtualmath.h"
  2. int main(int argc, char *argv[]) {
  3. Inter *inter = NULL;
  4. memVirtualMathUseJmp = true;
  5. if (setjmp(memVirtualMath_Env) == -1) // 遇到内存错误
  6. return 2;
  7. if (getArgs(argc, argv))
  8. goto args_error;
  9. inter = makeInter(args.out_file, args.error_file, NULL);
  10. for (ResultType status = not_return; status != error_return && argv[optind] != NULL; optind++)
  11. status = runCodeBlock(argv[optind], inter);
  12. printf("%s", HelloString);
  13. while (1){
  14. runCodeStdin(inter);
  15. if (ferror(stdin) || feof(stdin))
  16. break;
  17. }
  18. freeInter(inter, true);
  19. args_error: freeArgs();
  20. return 0;
  21. }
  22. /** TODO-szh List
  23. * 官方函数
  24. * 官方类
  25. */