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:
24
main.c
24
main.c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user