commit 2955f69f846844c8acffc2700aa4a3e775dbbfc9
parent a1efc9a28881be6b1a16ca6c896e088d1c86e78e
Author: thing1 <l.standen@posteo.com>
Date: Wed, 24 Sep 2025 11:28:58 +0100
worked on the html AST gen
Diffstat:
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/cmd/lav/lav.ha b/cmd/lav/lav.ha
@@ -10,6 +10,7 @@ use format::xml;
use memio;
use http;
+use html;
def url = "http://seacrossedlovers.xyz";
diff --git a/html/html.ha b/html/html.ha
@@ -0,0 +1,24 @@
+use fmt;
+use strings;
+use format::xml;
+
+export type block = struct {
+ tag: str,
+ attrs: xml::atribute,
+ content: (str | *block)
+};
+
+export fn mktree(par: *xml::parser) (str | *block) = {
+ return match (xml::scan(par)) {
+ case let start: xml::elementstart =>
+ yield &block {
+ tag = start,
+ content = match (xml::scan(par)) {
+ case let text: xml::text => yield text;
+ case let nested: xml::elementstart => yield mktree(par);
+ case let attr
+ }
+ };
+ case let text: xml::text => yield text;
+ };
+};