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
+8 -7
View File
@@ -1,11 +1,12 @@
import 'console';
class Test1 {
public void __construct() {
print("Test1::__construct() called.\n");
Console::Print("Test1::__construct() called.\n");
}
public void __destruct() {
print("Test1::__destruct() called.\n");
Console::Print("Test1::__destruct() called.\n");
}
}
@@ -13,12 +14,12 @@ class Test1 {
class Test2 extends Test1 {
public void __construct() {
print("Test2::__construct() called.\n");
Console::Print("Test2::__construct() called.\n");
$parent->__construct();
}
public void __destruct() {
print("Test2::__destruct() called.\n");
Console::Print("Test2::__destruct() called.\n");
$parent->__destruct();
}
@@ -28,16 +29,16 @@ class Program {
object $test;
public void __construct() {
print("Program::__construct() called.\n");
Console::Print("Program::__construct() called.\n");
$this->test = new Test1();
}
public void __destruct() {
print("Program::__destruct() called.\n");
Console::Print("Program::__destruct() called.\n");
}
public void main() {
print("Program::main() called.\n");
Console::Print("Program::main() called.\n");
object $test = new Test2();
}