Skip to content

Commit

Permalink
lisp - clear out the temp list after parsing an expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksherlock committed Feb 28, 2016
1 parent 92d32d1 commit 51cef14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/lisp.lemon
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ program ::= statement_list.

statement_list ::= statement(E). {
printf("%s\n", E ? E->to_string().c_str() : "#<nil>");

lisp::clear_temp_list();
}

/*
Expand Down
2 changes: 1 addition & 1 deletion test/lisp_cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace lisp {
static std::vector<void *> free_list;
static std::vector<chunk> storage;

void clear_temp_list() { temp_list.clear(); }

template<class T>
T *temp(T *t) { temp_list.push_back(t); return t; }
Expand Down Expand Up @@ -128,6 +127,7 @@ namespace lisp {



void clear_temp_list() { temp_list.clear(); }

void initialize(std::size_t size) {

Expand Down
4 changes: 2 additions & 2 deletions test/lisp_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class mexpr_parser : public lemon_base<Token>{
protected:
virtual void parse_failure() final override {
fail = true;
printf("Fail!\n");
//printf("Fail!\n");
}
virtual void parse_accept() final override {
printf("Accept!\n");
//printf("Accept!\n");
}

virtual void syntax_error(int yymajor, token_type &yyminor) final override {
Expand Down

0 comments on commit 51cef14

Please sign in to comment.