aboutsummaryrefslogtreecommitdiff
path: root/src/all.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-10 04:12:33 +0200
committerlemon <lsof@mailbox.org>2022-08-10 04:12:33 +0200
commitb33ee6afa74ab1e83554d1b535d81c7df0b3fca5 (patch)
treed5fb52a1529bf35658468adae796757e664bc792 /src/all.hff
parent769aa95cf3374117c86ec652117dcbab97497eec (diff)
many bugfix
Diffstat (limited to 'src/all.hff')
-rw-r--r--src/all.hff51
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;