diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..25a7384 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +*.exe diff --git a/Src/uno.c b/Src/uno.c index fd7d961..aec3ac3 100644 --- a/Src/uno.c +++ b/Src/uno.c @@ -63,7 +63,8 @@ uno_usage(void) fprintf(stderr, "\t-n ignore preprocessing directives in source files\n"); fprintf(stderr, "\t-o arg ignored, for modest compatability with cc arguments\n"); fprintf(stderr, "\t-m uno.dfn use master (type) definitions file uno.dfn\n"); - fprintf(stderr, "\t-x f declare f to be a function that does not return\n\n"); + fprintf(stderr, "\t-x f declare f to be a function that does not return.\n" + "\t\t\tOptional: Add :n where n is the number of parameters.\n"); fprintf(stderr, "\t-V print version number and exit\n"); fprintf(stderr, "\t-s print symbol table information and exit\n\n"); fprintf(stderr, "\t-l or -c perform only local analysis, not global\n"); diff --git a/Src/uno_lts.c b/Src/uno_lts.c index 1458181..a65447c 100644 --- a/Src/uno_lts.c +++ b/Src/uno_lts.c @@ -594,7 +594,7 @@ lts_redirect(State *s) frame->s = s; frame->nxt = stck; stck = frame; - + if (s->n->hdr.which == NODE_T) { switch (s->n->hdr.type) { case TN_JUMP: @@ -663,20 +663,22 @@ custom_exit(const char *s) { EX *nx; char *col; + nx = (EX *) emalloc(sizeof(EX)); + nx->f = (char *) emalloc(strlen(s)+1); + strcpy(nx->f, s); + col = strchr(s, ':'); if (col) { *col = '\0'; col++; + nx->has_arg = 1; + nx->arg_val = atoi(col); + } + else + { nx->has_arg = 0; + nx->arg_val = 0; } - nx = (EX *) emalloc(sizeof(EX)); - nx->f = (char *) emalloc(strlen(s)+1); - strcpy(nx->f, s); - if (col) - { nx->has_arg = 1; - nx->arg_val = atoi(col); - } else - nx->has_arg = 0; nx->nxt = exs; exs = nx; } @@ -1213,7 +1215,7 @@ static void uno_shared(void) { SymRef *r; int stc; - + for (r = globuse; r; r = r->nxt) { stc = r->status; @@ -3631,7 +3633,7 @@ lts_for(State *n, for_node *forn) t->hdr.deftyp = forn->test->hdr.deftyp; #endif } - t->cond = forn->test; + t->cond = forn->test; t->then_n = ts->n; /* just for form, */ t->else_n = es->n; /* the real info is in tr */