Added functionallity to handle functions

This commit is contained in:
2021-10-28 22:29:00 +02:00
parent e7f9ce4451
commit 2a65a66a86
5 changed files with 132 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ public lib Preview.Classes {
this._name = name;
}
public getName(): string {
public func getName(): string {
return this._name;
}
}

View File

@@ -2,4 +2,8 @@ public lib Preview.Functions {
public func isTrue(value: bool): bool {
return value;
}
public func add(value1: number, value2: number): number {
return value1 + value2;
}
}

View File

@@ -10,13 +10,13 @@ public lib Main {
this.test = Test(str);
}
public func Main(): void {
public func Main(): empty {
output(str, test, test2, test3);
output(isTrue(test));
output(this.test.getName());
}
private func testForEach(): void {
private func testForEach(): empty {
var loopList = [];
loopList.forEach(e => {
output(e);