Skip to content

Commit

Permalink
give the $ / 0 symbol a type of void so it won't be destructed when t…
Browse files Browse the repository at this point in the history
…here's a parse error.
  • Loading branch information
ksherlock committed Jan 31, 2016
1 parent d2eb969 commit f5471c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,9 @@ int main(int argc, char **argv)
int exitcode;
struct lemon lem;

struct symbol *dollar;


#ifdef LEMONPLUSPLUS
/* %define lemonplusplus */
handle_D_option("__lemonplusplus");
Expand Down Expand Up @@ -1580,7 +1583,11 @@ int main(int argc, char **argv)
lem.filename = OptArg(0);
lem.basisflag = basisflag;
lem.nolinenosflag = nolinenosflag;
Symbol_new("$");
dollar = Symbol_new("$");
#ifdef LEMONPLUSPLUS
dollar->datatype = "void";
#endif

lem.errsym = Symbol_new("error");
lem.errsym->datatype = "int";
lem.errsym->useCnt = 0;
Expand Down

0 comments on commit f5471c0

Please sign in to comment.