From 2bb2ff871fa1761478442bec5f6a32c9428360a1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 14:20:18 -0400 Subject: Change method calls to use `foo.baz()` instead of `foo:baz()` --- examples/shell/shell.tm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'examples/shell/shell.tm') diff --git a/examples/shell/shell.tm b/examples/shell/shell.tm index dd26428f..816d63a2 100644 --- a/examples/shell/shell.tm +++ b/examples/shell/shell.tm @@ -2,16 +2,16 @@ use commands lang Shell: convert(text:Text -> Shell): - return Shell.from_text("'" ++ text:replace($/'/, `'"'"'`) ++ "'") + return Shell.from_text("'" ++ text.replace($/'/, `'"'"'`) ++ "'") convert(texts:[Text] -> Shell): - return Shell.from_text(" ":join([Shell(t).text for t in texts])) + return Shell.from_text(" ".join([Shell(t).text for t in texts])) convert(path:Path -> Shell): - return Shell(Text(path:expand_home())) + return Shell(Text(path.expand_home())) convert(paths:[Path] -> Shell): - return Shell.from_text(" ":join([Shell(Text(p)).text for p in paths])) + return Shell.from_text(" ".join([Shell(Text(p)).text for p in paths])) convert(n:Int -> Shell): return Shell.from_text(Text(n)) convert(n:Int64 -> Shell): return Shell.from_text(Text(n)) @@ -25,20 +25,20 @@ lang Shell: return Command("sh", ["-c", shell.text]) func result(shell:Shell, input="", input_bytes:[Byte]=[] -> ProgramResult): - return shell:command():result(input=input, input_bytes=input_bytes) + return shell.command().result(input=input, input_bytes=input_bytes) func run(shell:Shell -> ExitType): - return shell:command():run() + return shell.command().run() func get_output(shell:Shell, input="", trim_newline=yes -> Text?): - return shell:command():get_output(input=input, trim_newline=trim_newline) + return shell.command().get_output(input=input, trim_newline=trim_newline) func get_output_bytes(shell:Shell, input="", input_bytes:[Byte]=[] -> [Byte]?): - return shell:command():get_output_bytes(input=input, input_bytes=input_bytes) + return shell.command().get_output_bytes(input=input, input_bytes=input_bytes) func by_line(shell:Shell -> func(->Text?)?): - return shell:command():by_line() + return shell.command().by_line() func main(command:Shell): - for line in command:by_line()!: + for line in command.by_line()!: >> line -- cgit v1.2.3