More parser — lint+tests pass again

This commit is contained in:
2024-12-30 01:05:10 +02:00
parent 6006a802e1
commit b8a52d3f39
10 changed files with 299 additions and 59 deletions

6
zig1.c
View File

@@ -6,7 +6,7 @@
// - code = 0: program successfully terminated.
// - code = 1: panicked, panic message in msg. Caller should free msg.
// - code = 2: interpreter error, error in msg. Caller should free msg.
int zig1Run(const char* program, char** msg) {
int zig0Run(const char* program, char** msg) {
(void)program;
(void)msg;
return 0;
@@ -14,7 +14,7 @@ int zig1Run(const char* program, char** msg) {
// API: run and:
// code = 3: abnormal error, expect something in stderr.
int zig1RunFile(const char* fname, char** msg) {
int zig0RunFile(const char* fname, char** msg) {
FILE* f = fopen(fname, "r");
if (f == NULL) {
perror("fopen");
@@ -51,7 +51,7 @@ int zig1RunFile(const char* fname, char** msg) {
fclose(f);
program[fsize] = 0;
int code = zig1Run(program, msg);
int code = zig0Run(program, msg);
free(program);
return code;
}