Skip to content

Commit d7c9b5d

Browse files
committed
module: Print to the output stream that is owned by the compiler
1 parent c1477c2 commit d7c9b5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/piccode/rt/modules/PiccodeIOModule.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44
import javax.swing.JOptionPane;
5+
import org.piccode.backend.Compiler;
56
import org.piccode.rt.Context;
67
import org.piccode.rt.PiccodeString;
78
import org.piccode.rt.PiccodeUnit;
@@ -17,7 +18,7 @@ public class PiccodeIOModule {
1718
public static void addFunctions() {
1819
NativeFunctionFactory.create("print", List.of("value"), (args, namedArgs, frame) -> {
1920
var value = namedArgs.get("value").toString();
20-
System.out.print(value);
21+
Compiler.out.print(value);
2122
return new PiccodeUnit();
2223
}, null);
2324

0 commit comments

Comments
 (0)