summaryrefslogtreecommitdiff
path: root/scripts/kmd/src/plan
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kmd/src/plan')
-rw-r--r--scripts/kmd/src/plan35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/kmd/src/plan b/scripts/kmd/src/plan
new file mode 100644
index 0000000..27e3040
--- /dev/null
+++ b/scripts/kmd/src/plan
@@ -0,0 +1,35 @@
+
+
+
+linebuf : [256]u8 = uninitialized
+linepos : size = 0;
+
+append :: action capture(linebuf, linepos) receive(s: str)
+do
+ linebuf.append(
+end
+
+define reset(linebuf) :: clear_to_zero(linebuf);
+define reset(linepos) :: linepos = 0;
+
+foreach (line in lines)
+do
+ reset linebuf, linepos;
+
+ if line.starts_with("# ")
+ append "<h1>";
+ append line[2..];
+ append "</h1>";
+ ...
+
+ # handle @@[][]
+ i : size = 0;
+ while (line.locate_next("@@[")) |pos|
+ do
+ std.mem.copy(dest: linebuf, src: line, from: i, to: pos);
+ append line[from:pos];
+
+ end
+
+
+end