diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-10 12:42:45 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-10 12:42:45 -0400 |
| commit | 39dd1ca27da9e9d88ee59565df99ee281e1b3632 (patch) | |
| tree | 107558459d134c052e5e912dceca03d0a0c26aa3 /test | |
| parent | 806e0d0554a8f619cb5b835e535f5f1022543c1a (diff) | |
Add `convert` keyword for defining conversions
Diffstat (limited to 'test')
| -rw-r--r-- | test/lang.tm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lang.tm b/test/lang.tm index 777a05b3..29936a62 100644 --- a/test/lang.tm +++ b/test/lang.tm @@ -1,6 +1,6 @@ lang HTML: HEADER := $HTML"<!DOCTYPE HTML>" - func HTML(t:Text->HTML): + convert(t:Text->HTML): t = t:replace_all({ $/&/="&", $/</="<", @@ -11,14 +11,14 @@ lang HTML: return HTML.without_escaping(t) - func HTML(i:Int->HTML): + convert(i:Int->HTML): return HTML.without_escaping("$i") func paragraph(content:HTML->HTML): return $HTML"<p>$content</p>" struct Bold(text:Text): - func HTML(b:Bold -> HTML): + convert(b:Bold -> HTML): return $HTML"<b>$(b.text)</b>" func main(): |
