Refactor for cleanliness

Move files into separate folders for ease of reading, include source
directory so we can use angle bracket includes, adjust build system to
make directories for objects
This commit is contained in:
2025-05-14 21:12:58 +01:00
parent ba5c0a4579
commit 12de1e8db9
18 changed files with 236 additions and 147 deletions

24
main.c
View File

@@ -13,12 +13,10 @@
* Description: Entrypoint
*/
#include "./base.h"
#include "./lisp.h"
#include "./memory.h"
#include "./reader.h"
#include "./sv.h"
#include "./vec.h"
#include <lib/sv.h>
#include <lib/vec.h>
#include <lisp/lisp.h>
#include <lisp/reader.h>
#include <assert.h>
#include <ctype.h>
@@ -27,6 +25,15 @@
#include <stdio.h>
#include <string.h>
void usage(char *prog_name, FILE *fp)
{
fprintf(fp,
"Usage: %s [FILE]\n"
"Interpret FILE as scheme in the OATS interpreter.\n"
"\t[FILE]: name of file\n",
prog_name);
}
int main(int argc, char *argv[])
{
int exit = 0;
@@ -36,7 +43,10 @@ int main(int argc, char *argv[])
if (argc > 1)
filename = argv[1];
else
filename = "./r7rs-tests.scm";
{
usage(argv[0], stderr);
return 1;
}
FILE *fp = fopen(filename, "r");
if (!fp)