diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
| commit | 074cf22ad462eafe963e4a749b2b74cab51211a1 (patch) | |
| tree | e1d7f938f2d949cc5dcf67ca648f200663e36562 /examples/wrap | |
| parent | 47fca946065508cff4151a32b3008c161983fd9d (diff) | |
Change function syntax from `func(args)->ret` to `func(args -> ret)`
Diffstat (limited to 'examples/wrap')
| -rw-r--r-- | examples/wrap/wrap.tm | 6 |
1 files changed, 3 insertions, 3 deletions
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: |
