diff options
Diffstat (limited to 'src/all.hff')
| -rw-r--r-- | src/all.hff | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/all.hff b/src/all.hff new file mode 100644 index 0000000..89f2b71 --- /dev/null +++ b/src/all.hff @@ -0,0 +1,51 @@ +import "libc.hff"; + +/// Macros + +defmacro assert { +(ex, s) [ + (do + if not (ex) { + fprintf(stderr, "%s:%d: assertion failed: ", #FILE, #LINE); + fprintf(stderr, "`%s'", (s)); + fprintf(stderr, "\n"); + abort(); + } + ) +] +} + +/// Types + +struct Loc { + fileid u16, + idx isize, + col int, + line int, +} + +#[lax] +enum TokT { + kw_or +} + +struct Tok { + t int, + u union { + i i64 + }, +} + +struct Decl { +} + +struct Parser { + +} + +// parse.cff +extern fn parse(P *Parser, path *const u8) [#]Decl; + +// util.cff +extern fn xmalloc(n usize) *void; +extern fn xrealloc(p *void, n usize) *void; |