Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Started the lever
Browse files Browse the repository at this point in the history
  • Loading branch information
oeed committed Apr 15, 2017
1 parent abc6f46 commit a1319f1
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 207 deletions.
Empty file added Example.luo
Empty file.
32 changes: 32 additions & 0 deletions Lexer/Example.luo
@@ -0,0 +1,32 @@
class Person: Object

property isMale: Boolean? -- allows nil
property age: Number = 0
property firstName: String
property lastName: String
property language: Language.Type = EnglishLanguage.self -- .Type means that rather than being an instance, the vaule has to be the class/static itself (or a subclass' class/static)

default otherThing = "One" -- overwrite the default value defined in a superclass

function initialise(firstName: String = "John", lastName: String = "Smith", isMale: Boolean)
-- anything here would need to support valid Lua
-- i.e. if you paste in vanilla Lua it'd work normally
-- this part is still statically typed though
local blah = "this" -- type = Any?
local num: Number = 4 -- this must be a number wherever its used

self.firstName = firstName
self.lastName = lastName
self.isMale = isMale
end

function test(value): Boolean
-- note that value currently has type Any?
if value is String then
-- value is 100% a string
end

-- what do we want optionals to do? do we want to have to unwrap them?
end

end
5 changes: 5 additions & 0 deletions Lexer/ex.lua
@@ -0,0 +1,5 @@
local var = 12

if var then
print("hello")
end

0 comments on commit a1319f1

Please sign in to comment.