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,15 +1,16 @@
import 'console';
class Program {
private const MY_CONST = 12 ^ 0x3FD;
private callback $callback_test = void(){ print("Welcome everyone!\n");};
private callback $callback_test = void(){ Console::Print("Welcome everyone!\n");};
private static int $value = 4 + 4 * 4;
void callable(callback $callback = void(){ print("Hello world!\n");}) {
void callable(callback $callback = void(){ Console::Print("Hello world!\n");}) {
$callback();
}
void complexArgs(string $name = 'AerScript' + $this->someStr(), int $age = 10*2+5) {
print("Name = $name\n");
print("Age = $age\n");
Console::Print("Name = $name\n");
Console::Print("Age = $age\n");
}
string someStr() {
@@ -33,10 +34,10 @@ class Program {
$this->complexArgs();
$this->complexArgs('Me');
$this->callable();
$this->callable(void(){ print("Welcome guest!\n");});
$this->callable(void(){ Console::Print("Welcome guest!\n");});
$this->callable($this->callback_test);
$this->someTrue() || print("someTrue() failed\n");
$this->someFalse() || print("someFalse() failed\n");
$this->someTrue() || Console::Print("someTrue() failed\n");
$this->someFalse() || Console::Print("someFalse() failed\n");
return 0;
}