parser echoing test in main repl

This commit is contained in:
Yuichi Nishiwaki 2013-10-11 15:20:53 +09:00
parent 8533d7b87f
commit 25d84c1e8a
2 changed files with 9 additions and 3 deletions

View File

@ -1,10 +1,14 @@
all: build run
build:
gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c
cd src; \
yacc -d parse.y; \
lex scan.l
gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c src/y.tab.c src/lex.yy.c
clean:
rm bin/picrin
rm -f src/y.tab.c src/y.tab.h src/lex.yy.c
rm -f bin/picrin
run:
bin/picrin

View File

@ -32,6 +32,7 @@ main()
pic_state *pic;
char line[LINE_MAX_LENGTH], last_char;
int char_index;
pic_value v;
pic = pic_open();
@ -51,8 +52,9 @@ main()
line[char_index] = '\0';
/* echo */
printf("%s", line);
v = pic_parse(pic, line);
pic_debug(pic, v);
printf("\n");
}