feat: implement M1 Ferro frontend
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
unit core;
|
||||
|
||||
pub error Error { Invalid = 1, Io = 2, }
|
||||
pub fn panic(msg: str, file: str, line: u32) { }
|
||||
pub fn assert(ok: bool) { }
|
||||
@@ -0,0 +1,4 @@
|
||||
unit fmt;
|
||||
pub fn write_str(w: &mut io.Writer, s: str) -> !void;
|
||||
pub fn write_int_i32(w: &mut io.Writer, v: i32) -> !void;
|
||||
pub fn write_bool(w: &mut io.Writer, v: bool) -> !void;
|
||||
@@ -0,0 +1,9 @@
|
||||
unit io;
|
||||
pub struct Writer {
|
||||
ctx: *void,
|
||||
write_fn: fn(*void, []u8) -> !usize,
|
||||
}
|
||||
pub struct File {
|
||||
handle: u16,
|
||||
pub fn close(self: &mut Self) { }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
unit list;
|
||||
pub struct List(T) {
|
||||
items: ^[]T,
|
||||
len: usize,
|
||||
pub fn at(self: &Self, i: usize) -> &T;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
unit map;
|
||||
pub struct Map(K, V) {
|
||||
len: usize,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
unit mem;
|
||||
|
||||
pub fn create(T: type) -> !^T;
|
||||
pub fn destroy(p: *void);
|
||||
pub fn copy(dst: []u8, src: []u8);
|
||||
pub struct Arena {
|
||||
ptr: *void,
|
||||
pub fn init() -> Arena { return Arena{ ptr: null }; }
|
||||
pub fn reset(self: &mut Self) { }
|
||||
pub fn drop(self: &mut Self) { }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
unit str;
|
||||
pub fn eq(a: str, b: str) -> bool;
|
||||
pub fn trim(s: str) -> str;
|
||||
@@ -0,0 +1,2 @@
|
||||
unit sys;
|
||||
pub fn exit(code: u16);
|
||||
Reference in New Issue
Block a user