started work on lexer
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
depend "io.pla"
|
||||
write("Hello, World!")
|
||||
print("Hello, World!")
|
||||
6
tests/lexer.pla
Normal file
6
tests/lexer.pla
Normal file
@@ -0,0 +1,6 @@
|
||||
123
|
||||
0.456
|
||||
[]
|
||||
{}
|
||||
(1 + 3 * 2 ^ 4) % 2
|
||||
2 - 1
|
||||
18
tests/types.pla
Normal file
18
tests/types.pla
Normal 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, }
|
||||
@@ -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))
|
||||
Reference in New Issue
Block a user