hkl/hkl — pull request #19 by pyrated (2012-09-15 02:18:58+00:00)
Title: Adds Finished Grammar?

I hope this is everything. Since we will just run code statement-by-
statement now, we didn't need 'implicit self' function forms.
We will still look for "self" as a first argument to a function now
though, if it is we'll set a flag or something saying that this function
well grab a reference to it's calling object when it is executed.
Obviously, if there is no calling object, then self will be nil.

Additionally, I fixed some typos.

The current grammar examples:

// The prototype keyword means MyClass will always be
// of type "class" and never anything else
// Its intenal values can change

// The constant keyword means MyClass cannot
// change its internal values, so its symbol table
// is constant
unique constant prototype class MyClass

g = nil

function new()

c = MyClass
c.g = "test"
return c
end

// Self is a special keyword
// if we see it then this function will
// be "tagged" specially
setg = function(self, newg)

self.g = newg
end

end

o = MyClass.new()

// Now we can just call setg without worrying about "self"
o.setg(112)

Hash Tables:

h = { "key" : 111,
12 : "value",
3.14 : "no problem"
QQ : "gg no re" }
// All keys are interpreted as strings

Everything else is pretty much self explanitory.