Added Doxyfile, updated Makefile, reformatted.

This commit is contained in:
Simon Brooke 2018-12-06 18:09:18 +00:00
parent 3112f190db
commit 88fd7d95d9
8 changed files with 2570 additions and 71 deletions

2
.gitignore vendored
View file

@ -16,3 +16,5 @@ src/\.#*
\.idea/ \.idea/
post-scarcity\.iml post-scarcity\.iml
doc/

2494
Doxyfile Normal file

File diff suppressed because it is too large Load diff

View file

@ -3,9 +3,12 @@ TARGET ?= target/psse
SRC_DIRS ?= ./src SRC_DIRS ?= ./src
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
HDRS := $(shell find $(SRC_DIRS) -name *.h)
OBJS := $(addsuffix .o,$(basename $(SRCS))) OBJS := $(addsuffix .o,$(basename $(SRCS)))
DEPS := $(OBJS:.o=.d) DEPS := $(OBJS:.o=.d)
TESTS := $(shell find unit-tests -name *.sh)
INC_DIRS := $(shell find $(SRC_DIRS) -type d) INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS)) INC_FLAGS := $(addprefix -I,$(INC_DIRS))
INDENT_FLAGS := -kr -br -brf -brs -ce -cdw -npsl -nut -prs -l79 -ts2 INDENT_FLAGS := -kr -br -brf -brs -ce -cdw -npsl -nut -prs -l79 -ts2
@ -18,10 +21,13 @@ LDFLAGS := -lm
$(TARGET): $(OBJS) Makefile $(TARGET): $(OBJS) Makefile
$(CC) $(LDFLAGS) $(OBJS) -DVERSION=$(VERSION) -o $@ $(LDFLAGS) $(LOADLIBES) $(LDLIBS) $(CC) $(LDFLAGS) $(OBJS) -DVERSION=$(VERSION) -o $@ $(LDFLAGS) $(LOADLIBES) $(LDLIBS)
format: doc: $(SRCS) Makefile
indent $(INDENT_FLAGS) $(SRCS) src/*.h doxygen
test: format: $(SRCS) $(HDRS) Makefile
indent $(INDENT_FLAGS) $(SRCS) $(HDRS)
test: $(OBJS) $(TESTS) Makefile
bash ./unit-tests.sh bash ./unit-tests.sh
.PHONY: clean .PHONY: clean

View file

@ -81,7 +81,9 @@ struct cons_pointer c_cdr( struct cons_pointer arg ) {
* @param env the evaluation environment. * @param env the evaluation environment.
* @return the result of evaluating the form. * @return the result of evaluating the form.
*/ */
struct cons_pointer eval_form( struct stack_frame *parent, struct cons_pointer form, struct cons_pointer env) { struct cons_pointer eval_form( struct stack_frame *parent,
struct cons_pointer form,
struct cons_pointer env ) {
fputws( L"eval_form: ", stderr ); fputws( L"eval_form: ", stderr );
print( stderr, form ); print( stderr, form );
fputws( L"\n", stderr ); fputws( L"\n", stderr );
@ -161,8 +163,7 @@ c_apply( struct stack_frame *frame, struct cons_pointer env ) {
* @param pointer a pointer to the object whose type is requested. * @param pointer a pointer to the object whose type is requested.
* @return As a Lisp string, the tag of the object which is at that pointer. * @return As a Lisp string, the tag of the object which is at that pointer.
*/ */
struct cons_pointer struct cons_pointer c_type( struct cons_pointer pointer ) {
c_type( struct cons_pointer pointer) {
char *buffer = malloc( TAGLENGTH + 1 ); char *buffer = malloc( TAGLENGTH + 1 );
memset( buffer, 0, TAGLENGTH + 1 ); memset( buffer, 0, TAGLENGTH + 1 );
struct cons_space_object cell = pointer2cell( pointer ); struct cons_space_object cell = pointer2cell( pointer );
@ -489,9 +490,8 @@ lisp_cond( struct stack_frame *frame, struct cons_pointer env ) {
} else if ( nilp( clause_pointer ) ) { } else if ( nilp( clause_pointer ) ) {
done = true; done = true;
} else { } else {
lisp_throw( lisp_throw( c_string_to_lisp_string
c_string_to_lisp_string( "Arguments to `cond` must be lists"), ( "Arguments to `cond` must be lists" ), frame );
frame);
} }
} }
/* TODO: if there are more than 8 clauses we need to continue into the /* TODO: if there are more than 8 clauses we need to continue into the

View file

@ -28,8 +28,7 @@
* @param pointer a pointer to the object whose type is requested. * @param pointer a pointer to the object whose type is requested.
* @return As a Lisp string, the tag of the object which is at that pointer. * @return As a Lisp string, the tag of the object which is at that pointer.
*/ */
struct cons_pointer struct cons_pointer c_type( struct cons_pointer pointer );
c_type( struct cons_pointer pointer);
/* /*
* special forms * special forms

View file

@ -157,9 +157,7 @@ void dump_frame( FILE * output, struct stack_frame *frame ) {
fwprintf( output, L"Arg %d:\t%c%c%c%c\t", arg, fwprintf( output, L"Arg %d:\t%c%c%c%c\t", arg,
cell.tag.bytes[0], cell.tag.bytes[0],
cell.tag.bytes[1], cell.tag.bytes[1], cell.tag.bytes[2], cell.tag.bytes[3] );
cell.tag.bytes[2],
cell.tag.bytes[3]);
print( output, frame->arg[arg] ); print( output, frame->arg[arg] );
fputws( L"\n", output ); fputws( L"\n", output );