From e095c7fb6429dd448c24f69a92f3cb4ebee8a8b0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 11 Mar 2025 00:45:52 -0400 Subject: [PATCH] Add a few colorful escapes --- examples/colorful/colorful.tm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/colorful/colorful.tm b/examples/colorful/colorful.tm index ca34c29..bcc95eb 100644 --- a/examples/colorful/colorful.tm +++ b/examples/colorful/colorful.tm @@ -11,6 +11,9 @@ lang Colorful: text = text:replace_all({$/@/="@(at)", $/(/="@(lparen)", $/)/="@(rparen)"}) return Colorful.without_escaping(text) + convert(i:Int -> Colorful): return Colorful.without_escaping("$i") + convert(n:Num -> Colorful): return Colorful.without_escaping("$n") + func for_terminal(c:Colorful -> Text): return CSI ++ "m" ++ _for_terminal(c, _TermState())