summaryrefslogtreecommitdiff
path: root/muse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-06-07 18:56:35 -0400
committerOri Bernstein <ori@eigenstate.org>2012-06-07 18:56:35 -0400
commitc98afde323137b801e18e42c3cb99fb51b1d6011 (patch)
treecf9f63d4452ec924145ff106eca7c3d4e357b40a /muse
parent9220a5e91430f73453e50cc48ffee026587e0e53 (diff)
downloadmc-c98afde323137b801e18e42c3cb99fb51b1d6011.tar.gz
Move debug pickling dump out of the compiler.
We'll put it in the usefile generator.
Diffstat (limited to 'muse')
-rw-r--r--muse/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/muse/main.c b/muse/main.c
index b46ef08..1255b76 100644
--- a/muse/main.c
+++ b/muse/main.c
@@ -28,6 +28,8 @@ int main(int argc, char **argv)
int opt;
int i;
Stab *globls;
+ Node *rdback;
+ FILE *tmp;
while ((opt = getopt(argc, argv, "dho:")) != -1) {
switch (opt) {
@@ -55,6 +57,17 @@ int main(int argc, char **argv)
yyparse();
if (debug) {
+ /* test storing tree to file */
+ tmp = fopen("a.pkl", "w");
+ pickle(file, tmp);
+ fclose(tmp);
+
+ /* and reading it back */
+ tmp = fopen("a.pkl", "r");
+ rdback = unpickle(tmp);
+ dump(rdback, stdout);
+ fclose(tmp);
+
/* before we do anything to the parse */
dump(file, stdout);
}