Add TextWriter, IOException, per-VM module data and pre-load imports; Add console module with Console class
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'console';
|
||||
class Program {
|
||||
|
||||
string[] testArray() {
|
||||
@@ -5,16 +6,18 @@ class Program {
|
||||
}
|
||||
|
||||
callback[] testCallback() {
|
||||
return {'callme' => void() { print("Hello world\n"); }};
|
||||
return {'callme' => void() { Console::Print("Hello world\n"); }};
|
||||
}
|
||||
|
||||
public void main() {
|
||||
callback[] $constr = {'print'};
|
||||
print($this->testArray()['Machine'] + "\n");
|
||||
callback[] $constr = { void(string $s) { Console::Print($s); } };
|
||||
Console::Print($this->testArray()['Machine'] + "\n");
|
||||
$this->testCallback()['callme']();
|
||||
print(true ? "TRUE\n" : false ? "true\n" : "false\n");
|
||||
(void(string $name) { print("This should work too - $name.\n");})('AerScript');
|
||||
Console::Print(true ? "TRUE\n" : false ? "true\n" : "false\n");
|
||||
(void(string $name) { Console::Print("This should work too - $name.\n");})('AerScript');
|
||||
$constr[0]('Test finished.' + "\n");
|
||||
callback[] $map = {'up' => 'strtoupper', 'low' => 'strtolower'};
|
||||
Console::Print("%s|%s\n", $map['up']("UPPER/lower"), $map['low']("UPPER/lower"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user