file imports work!!!!!

This commit is contained in:
SpookyDervish
2025-10-18 07:21:19 +11:00
parent 24fcbb3fb7
commit 52686fa314
15 changed files with 210 additions and 73 deletions

View File

@@ -1,9 +0,0 @@
depend "io.pla"
if 1 + 2 == 3 {
print("The universe is functional!");
}
unless
{
print("WHAT, HOW");
}

View File

@@ -1,8 +0,0 @@
depend "io.pla"
depend "string.pla"
add = Func(a: Int, b: Int): Int {
return a + b;
}
print(String(add(1, 3)));

View File

@@ -1,4 +1,4 @@
main = Func(): Int {
$print("Hello, World!");
$print("Hello, World!\n");
return 0;
}

3
tests/math.pla Normal file
View File

@@ -0,0 +1,3 @@
add = Func(a: Int, b: Int): Int {
return a + b;
}

View File

@@ -1,7 +1,5 @@
depend "tests/math.pla";
main = Func(): Int {
a: Int = 10;
a += 1;
return a;
return $add(1 ,2);
}

View File

@@ -1,19 +0,0 @@
depend "io.pla"
enum Gender {
male,
female
}
struct Person {
name: String,
age: Int = 0,
speak: Func,
gender: Gender
}
speak = Func(sentence: String): Nil {
print(sentence)
}
max: Person = {"Max", 17, speak, Gender.male};

View File

@@ -1,16 +0,0 @@
depend "string.pla"
depend "io.h"
myInt: Int = 123;
myDecimal: Float = 0.456;
myBoolean: Bool = true;
myString: String = "Hello!\n";
myList: List = [1, "hi", true, [1, 2, 3], 0.789];
MY_CONSTANT: Const(String) = "foo bar";
print(String(myInt));
print(String(myDecimal));
print(String(myBoolean));
print(myString);
print(String(myList));