From 074cf22ad462eafe963e4a749b2b74cab51211a1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 9 Oct 2024 13:26:28 -0400 Subject: Change function syntax from `func(args)->ret` to `func(args -> ret)` --- examples/wrap/wrap.tm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/wrap/wrap.tm') diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm index a89d8b41..ced8aab1 100644 --- a/examples/wrap/wrap.tm +++ b/examples/wrap/wrap.tm @@ -13,7 +13,7 @@ HELP := " UNICODE_HYPHEN := \{hyphen} -func unwrap(text:Text, preserve_paragraphs=yes, hyphen=UNICODE_HYPHEN)->Text: +func unwrap(text:Text, preserve_paragraphs=yes, hyphen=UNICODE_HYPHEN -> Text): if preserve_paragraphs: paragraphs := text:split($/{2+ nl}/) if paragraphs.length > 1: @@ -21,7 +21,7 @@ func unwrap(text:Text, preserve_paragraphs=yes, hyphen=UNICODE_HYPHEN)->Text: return text:replace($/$(hyphen)$(\n)/, "") -func wrap(text:Text, width:Int, min_split=3, hyphen="-")->Text: +func wrap(text:Text, width:Int, min_split=3, hyphen="-" -> Text): if width <= 0: fail("Width must be a positive integer, not $width") @@ -71,7 +71,7 @@ func wrap(text:Text, width:Int, min_split=3, hyphen="-")->Text: return \n:join(lines) -func _can_fit_word(line:Text, letters:[Text], width:Int; inline)->Bool: +func _can_fit_word(line:Text, letters:[Text], width:Int -> Bool; inline): if line == "": return letters.length <= width else: -- cgit v1.2.3