reorganized files

This commit is contained in:
Francesco Cozzuto
2021-12-01 14:43:11 +01:00
parent a7cdb0943d
commit fb9b22fa46
6 changed files with 22 additions and 22 deletions
+7 -5
View File
@@ -22,6 +22,7 @@ gcc -c src/objects/o_none.c -o temp/objects/o_none.o $FLAGS
gcc -c src/objects/o_bool.c -o temp/objects/o_bool.o $FLAGS gcc -c src/objects/o_bool.c -o temp/objects/o_bool.o $FLAGS
gcc -c src/objects/o_float.c -o temp/objects/o_float.o $FLAGS gcc -c src/objects/o_float.c -o temp/objects/o_float.o $FLAGS
gcc -c src/objects/o_string.c -o temp/objects/o_string.o $FLAGS gcc -c src/objects/o_string.c -o temp/objects/o_string.o $FLAGS
gcc -c src/objects/o_closure.c -o temp/objects/o_closure.o $FLAGS
gcc -c src/objects/objects.c -o temp/objects/objects.o $FLAGS gcc -c src/objects/objects.c -o temp/objects/objects.o $FLAGS
mkdir temp/compiler mkdir temp/compiler
@@ -35,11 +36,11 @@ gcc -c src/common/executable.c -o temp/common/executable.o $FLAGS
mkdir temp/runtime mkdir temp/runtime
gcc -c src/runtime/runtime_error.c -o temp/runtime/runtime_error.o $FLAGS gcc -c src/runtime/runtime_error.c -o temp/runtime/runtime_error.o $FLAGS
gcc -c src/runtime/runtime.c -o temp/runtime/runtime.o $FLAGS gcc -c src/runtime/runtime.c -o temp/runtime/runtime.o $FLAGS
gcc -c src/runtime/o_builtins.c -o temp/runtime/o_builtins.o $FLAGS
gcc -c src/runtime/o_closure.c -o temp/runtime/o_closure.o $FLAGS
gcc -c src/runtime/o_nfunc.c -o temp/runtime/o_nfunc.o $FLAGS gcc -c src/runtime/o_nfunc.c -o temp/runtime/o_nfunc.o $FLAGS
gcc -c src/runtime/o_func.c -o temp/runtime/o_func.o $FLAGS gcc -c src/runtime/o_func.c -o temp/runtime/o_func.o $FLAGS
gcc -c src/o_builtins.c -o temp/o_builtins.o $FLAGS
rm -rf build rm -rf build
mkdir build mkdir build
@@ -68,7 +69,9 @@ ar rcs build/libnoja-runtime.a \
gcc tests/src/test-parse.c -o build/test-parse $FLAGS -Lbuild/ -lnoja-compile -lxjson gcc tests/src/test-parse.c -o build/test-parse $FLAGS -Lbuild/ -lnoja-compile -lxjson
gcc tests/src/test-objects.c -o build/test-objects $FLAGS -Lbuild/ -lnoja-objects gcc tests/src/test-objects.c -o build/test-objects $FLAGS -Lbuild/ -lnoja-objects
gcc src/main.c src/debug.c \ gcc src/main.c \
src/debug.c \
temp/o_builtins.o \
temp/utils/hash.o \ temp/utils/hash.o \
temp/utils/stack.o \ temp/utils/stack.o \
temp/utils/source.o \ temp/utils/source.o \
@@ -79,10 +82,9 @@ gcc src/main.c src/debug.c \
temp/objects/o_list.o \ temp/objects/o_list.o \
temp/objects/o_bool.o \ temp/objects/o_bool.o \
temp/objects/o_string.o \ temp/objects/o_string.o \
temp/objects/o_closure.o \
temp/runtime/runtime.o \ temp/runtime/runtime.o \
temp/runtime/runtime_error.o \ temp/runtime/runtime_error.o \
temp/runtime/o_builtins.o \
temp/runtime/o_closure.o \
temp/runtime/o_nfunc.o \ temp/runtime/o_nfunc.o \
temp/runtime/o_func.o \ temp/runtime/o_func.o \
temp/common/executable.o \ temp/common/executable.o \
+2
View File
@@ -14,6 +14,8 @@
* $ noja -f <file> -o <file> * $ noja -f <file> -o <file>
*/ */
Object *Object_NewBuiltinsMap(Runtime *runtime, Heap *heap, Error *err);
typedef enum { RUN, HELP, PARSE, VERSION, DISASSEMBLY } Action; typedef enum { RUN, HELP, PARSE, VERSION, DISASSEMBLY } Action;
typedef struct { typedef struct {
@@ -2,8 +2,8 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "runtime.h" #include "runtime/runtime.h"
#include "../utils/defs.h" #include "utils/defs.h"
static Object *select_(Object *self, Object *key, Heap *heap, Error *err); static Object *select_(Object *self, Object *key, Heap *heap, Error *err);
static int count(Object *self); static int count(Object *self);
@@ -1,8 +1,5 @@
// NOTE: This data structure doesn't strictly depend on
// the runtime, so it could be moved to src/objects.
#include "../utils/defs.h" #include "../utils/defs.h"
#include "../objects/objects.h" #include "objects.h"
typedef struct ClosureObject ClosureObject; typedef struct ClosureObject ClosureObject;
+1
View File
@@ -86,6 +86,7 @@ Object* Object_Prev (Object *iter, Heap *heap, Error *err);
Object* Object_NewMap(int num, Heap *heap, Error *error); Object* Object_NewMap(int num, Heap *heap, Error *error);
Object* Object_NewList(int capacity, Heap *heap, Error *error); Object* Object_NewList(int capacity, Heap *heap, Error *error);
Object* Object_NewNone(Heap *heap, Error *error); Object* Object_NewNone(Heap *heap, Error *error);
Object* Object_NewClosure(Object *parent, Object *new_map, Heap *heap, Error *error);
Object* Object_FromInt (long long int val, Heap *heap, Error *error); Object* Object_FromInt (long long int val, Heap *heap, Error *error);
Object* Object_FromBool (_Bool val, Heap *heap, Error *error); Object* Object_FromBool (_Bool val, Heap *heap, Error *error);
-2
View File
@@ -25,8 +25,6 @@ void Snapshot_Print(Snapshot *snapshot, FILE *fp);
Object *run(Runtime *runtime, Error *error, Executable *exe, int index, Object *closure, Object **argv, int argc); Object *run(Runtime *runtime, Error *error, Executable *exe, int index, Object *closure, Object **argv, int argc);
Object *Object_NewClosure(Object *parent, Object *new_map, Heap *heap, Error *error);
Object *Object_NewBuiltinsMap(Runtime *runtime, Heap *heap, Error *err);
Object* Object_FromNativeFunction(Runtime *runtime, Object *(*callback)(Runtime*, Object**, unsigned int, Error*), int argc, Heap *heap, Error *error); Object* Object_FromNativeFunction(Runtime *runtime, Object *(*callback)(Runtime*, Object**, unsigned int, Error*), int argc, Heap *heap, Error *error);
Object *Object_FromNojaFunction(Runtime *runtime, Executable *exe, int index, int argc, Object *closure, Heap *heap, Error *error); Object *Object_FromNojaFunction(Runtime *runtime, Executable *exe, int index, int argc, Object *closure, Heap *heap, Error *error);
#endif #endif