diff options
Diffstat (limited to 'bootstrap/all.h')
| -rw-r--r-- | bootstrap/all.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bootstrap/all.h b/bootstrap/all.h index fa24479..3048d99 100644 --- a/bootstrap/all.h +++ b/bootstrap/all.h @@ -2,6 +2,7 @@ #include "vec.h" #include <assert.h> +#include <errno.h> #include <limits.h> #include <stdarg.h> #include <stddef.h> @@ -42,6 +43,7 @@ struct span { _(fn) \ _(for) \ _(if) \ + _(import) \ _(let) \ _(not) \ _(or) \ @@ -124,6 +126,7 @@ struct parser { int expanno; const struct type *targty; bool used_targty; + bool is_header; }; enum typetype { @@ -366,8 +369,12 @@ struct stmt { }; }; -struct transunit { - slice_t(struct decl) decls; +struct declsl { + slice_t(struct decl); +}; + +struct comfile { + struct declsl decls; }; /************/ @@ -447,7 +454,7 @@ void noreturn fatal(struct parser *, struct span, const char *fmt, ...); /** parse.c **/ extern const char *keyword2str[]; -void parse(struct transunit *, struct parser *); +void parse(struct comfile *, struct parser *); void initparser(struct parser *, const char *fname); /** types.c **/ @@ -481,7 +488,7 @@ bool envput(struct env *, const struct decl *decl); struct env *mkenv(const struct env *parent); /** dump.c **/ -void dumptransunit(const struct transunit *); +void dumpcomfile(const struct comfile *); const char *tokt2str(int); const char *tok2str(struct tok); void pritoktree(struct toktree); @@ -489,7 +496,7 @@ void epri(const char *fmt, ...); void vepri(const char *fmt, va_list); /** cgen.c **/ -void cgen(FILE *, const struct transunit *); +void cgen(FILE *, const struct comfile *); /** fold.c **/ int fold(struct expr *); |