diff --git a/dist/platform/elc b/dist/platform/elc index d3abc23..3f5b8e4 100755 Binary files a/dist/platform/elc and b/dist/platform/elc differ diff --git a/examples/html-page.el b/examples/html-page.el new file mode 100644 index 0000000..95019ff --- /dev/null +++ b/examples/html-page.el @@ -0,0 +1,40 @@ +// html-page.el — Example of native HTML template syntax in El. +// +// El HTML templates let you write HTML directly in expression position. +// Interpolated values are automatically HTML-escaped. +// Use raw(expr) to bypass escaping when you know the content is safe. +// +// Compile and run: +// ./dist/platform/elc examples/html-page.el > /tmp/html-page.c +// cc -std=c11 -I el-compiler/runtime -lcurl -lpthread \ +// -o /tmp/html-page /tmp/html-page.c el-compiler/runtime/el_runtime.c +// /tmp/html-page + +fn render_item(item: String) -> String { + return
Built with El HTML templates
+ + +} + +fn main() -> Void { + let items: [String] = ["Lexer", "Parser", "Codegen", "Runtime"] + let page: String = render_page("El Compiler Stages", items) + println(page) +}