Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class

This commit is contained in:
2026-11-23 18:36:46 +01:00
parent 2243557bf5
commit 4d06edd045
55 changed files with 1679 additions and 675 deletions
+5 -4
View File
@@ -1,3 +1,4 @@
import 'console';
class Program {
string encode_ip(string $dotquad_ip) {
@@ -12,11 +13,11 @@ class Program {
public void main() {
string $localhost = $this->encode_ip('127.0.0.1');
print("127.0.0.1 ==> $localhost\n");
Console::Print("127.0.0.1 ==> $localhost\n");
string $router = $this->encode_ip('192.168.2.1');
print("192.168.2.1 ==> $router\n");
print("$localhost ==> ", $this->decode_ip($localhost) + PHP_EOL);
print("$router ==> ", $this->decode_ip($router) + PHP_EOL);
Console::Print("192.168.2.1 ==> $router\n");
Console::Print("$localhost ==> " + ($this->decode_ip($localhost) + PHP_EOL));
Console::Print("$router ==> " + ($this->decode_ip($router) + PHP_EOL));
}
}