started work on lexer

This commit is contained in:
SpookyDervish
2025-10-13 06:55:35 +11:00
parent 6da4f73ffb
commit 07ca0fcc32
7 changed files with 193 additions and 6 deletions

View File

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

6
tests/lexer.pla Normal file
View File

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

18
tests/types.pla Normal file
View File

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

View File

@@ -6,8 +6,10 @@ myBoolean: Bool = true
myString: String = "Hello!\n"
myList: List = [1, "hi", true, [1, 2, 3], 0.789]
write(String(myInt))
write(String(myDecimal))
write(String(myBoolean))
write(myString)
write(String(myList))
MY_CONSTANT: Const(String) = "foo bar"
print(String(myInt))
print(String(myDecimal))
print(String(myBoolean))
print(myString)
print(String(myList))