aboutsummaryrefslogtreecommitdiff
path: root/test/lang.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-03 13:19:41 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-03 13:19:41 -0400
commit64143f0a131a053414e4b73c17bff994522b11c2 (patch)
tree2545507fde623f8846bf183388acdbb0234b5e65 /test/lang.tm
parent5feecff9d93522002c74a1423d138c2aa8bc150d (diff)
Syntax overhaul (comments back to `#`, print statments to `!!`),
using `$/.../` for patterns and using a DSL for patterns
Diffstat (limited to 'test/lang.tm')
-rw-r--r--test/lang.tm10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/lang.tm b/test/lang.tm
index d78476de..e2093a6e 100644
--- a/test/lang.tm
+++ b/test/lang.tm
@@ -1,11 +1,11 @@
lang HTML:
HEADER := $HTML"<!DOCTYPE HTML>"
func escape(t:Text)->HTML:
- t = t:replace("&", "&amp;")
- t = t:replace("<", "&lt;")
- t = t:replace(">", "&gt;")
- t = t:replace('"', "&quot;")
- t = t:replace("'", "&#39;")
+ t = t:replace($/&/, "&amp;")
+ t = t:replace($/</, "&lt;")
+ t = t:replace($/>/, "&gt;")
+ t = t:replace($/"/, "&quot;")
+ t = t:replace($/'/, "&#39;")
return HTML.from_unsafe_text(t)
func escape_int(i:Int)->HTML: