VARIABLESSSS

This commit is contained in:
SpookyDervish
2025-10-13 21:05:03 +11:00
parent 4e17674361
commit f9cd1dba29
17 changed files with 366 additions and 65 deletions

View File

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

View File

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

View File

@@ -1,2 +1,2 @@
depend "io.pla"
print("Hello, World!")
print("Hello, World!");

View File

@@ -1,6 +0,0 @@
123
0.456
[]
{}
(1 + 3 * 2 ^ 4) % 2
2 - 1

View File

@@ -1 +0,0 @@
(5 + 5) * 3 + 2

2
tests/test.pla Normal file
View File

@@ -0,0 +1,2 @@
a: Float = 1.23;
b: Int = 456;

View File

@@ -14,6 +14,6 @@ struct Person {
speak = Func(sentence: String): Nil {
print(sentence)
}
}
max: Person = {"Max", 17, }
max: Person = {"Max", 17, speak, Gender.male};

View File

@@ -1,16 +1,16 @@
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]
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"
MY_CONSTANT: Const(String) = "foo bar";
print(String(myInt))
print(String(myDecimal))
print(String(myBoolean))
print(myString)
print(String(myList))
print(String(myInt));
print(String(myDecimal));
print(String(myBoolean));
print(myString);
print(String(myList));