Variableize Makefile and adjust pebble tokens
Also made repl() a void function
This commit is contained in:
parent
8bdf42f6fd
commit
7ad541eb02
11
src/Makefile
11
src/Makefile
|
@ -1,16 +1,17 @@
|
|||
files = pebblisp.c tokens.c object.c env.c
|
||||
exe = pebblisp
|
||||
|
||||
all:
|
||||
gcc -g -O0 -o pebblisp -D STANDALONE $(files) && ./tests.sh
|
||||
gcc -g -O0 -o $(exe) -D STANDALONE $(files) && ./tests.sh
|
||||
|
||||
notest:
|
||||
gcc -g -O0 -o pebblisp -D STANDALONE $(files)
|
||||
gcc -g -O0 -o $(exe) -D STANDALONE $(files)
|
||||
|
||||
val:
|
||||
gcc -g -O0 -o pebblisp -D STANDALONE $(files) && ./tests.sh -val
|
||||
gcc -g -O0 -o $(exe) -D STANDALONE $(files) && ./tests.sh -val
|
||||
|
||||
debug:
|
||||
gcc -g -O0 -o pebblisp -D STANDALONE -D DEBUG $(files) && ./tests.sh
|
||||
gcc -g -O0 -o $(exe) -D STANDALONE -D DEBUG $(files) && ./tests.sh
|
||||
|
||||
run:
|
||||
./pebblisp
|
||||
./$(exe)
|
||||
|
|
|
@ -41,16 +41,16 @@ char temptext[SMAX_LENGTH] = "";
|
|||
char resulttext[RESULT_LENGTH] = "";
|
||||
|
||||
char *tokens[] = {
|
||||
" ", "(", ")",
|
||||
" ", "(", ")",
|
||||
"+ ", "- ", "* ", "/ ",
|
||||
"1","2","3",
|
||||
"4","5","6",
|
||||
"7","8","9", "0",
|
||||
"a", "b", "c", "d", "e",
|
||||
"= ", "< ", "> ",
|
||||
"spent", "window",
|
||||
"spent ", "window",
|
||||
"\"",
|
||||
"map", "fn", "def", "if", "\n",
|
||||
"cat", "map", "fn", "def", "if", "\n",
|
||||
END_PHRASE
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,8 @@ void eval_forms(Object *destList, const Object *src, struct Environment *env)
|
|||
{
|
||||
int length = listLength(src) - 1; // Not counting first_form
|
||||
for(int i = 0; i < length; i++) { // Evaluates all in list
|
||||
destList[i] = eval(itemAt(src, i + 1), env); // Skip the first
|
||||
Object *ptr = itemAt(src, i + 1); // Skip the first
|
||||
destList[i] = eval(ptr, env);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -411,7 +412,7 @@ Object parseEval(const char *input, struct Environment *env)
|
|||
}
|
||||
|
||||
#ifdef STANDALONE
|
||||
int repl(struct Environment *env)
|
||||
void repl(struct Environment *env)
|
||||
{
|
||||
char input[200] = "";
|
||||
while(input[0] != 'q') {
|
||||
|
|
Loading…
Reference in New Issue