Commit Graph

7 Commits

Author SHA1 Message Date
Thakee Nathees
5bc9dcad6b method bind implemented
- MethodBind type added.
- Now methods are first class and can be passed around as arguments
  store as a variable and return it from a function and they're first
  class callbales.
- Can bind instance to a method bind using .bind() method
- Class.methods() method added -> return a list of all methods as
  method binds
- Module.globals() method added -> returns a list of all globals
  of that module.
- Var._class -> attribute added which will return the class of the
  variable
- Class.name, MethodBind.name, Closure.name attribute and Modue._name
  attribute added
- Class._docs, Closure._docs, MethodBind._docs attribute added
- MethodBind.instance attribute added
2022-06-06 02:47:31 +05:30
Thakee Nathees
6e91b66e69 else if change to elif again.
The primary purpose of this change is to disambiguate between
`else if` and `else \n if`.

Even though it's a breaking change, since it's at the very early
state we're allowed to make such breaking syntax change.

lang.write function moved to io and io.stdin, io.stdout, io.stderr
added for future streamed io operations

io.File read, write, open, close, getline, seek, tell implemented

str * int multiplication implemented
2022-05-24 15:31:36 +05:30
Thakee Nathees
2fe579d9cc math module moved to cli/modules 2022-04-22 07:04:09 +05:30
Thakee Nathees
88c45cccac function and else if keywords are changed.
- `func` keyword has change to `function`.
- `elsif` changed to `else if`
2022-04-17 07:33:40 +05:30
Thakee Nathees
8c039b5d77 fn, cls moved to constants buffer
functions and classes are moved to constant buffer, and forward
names are resolved for globals.
2022-04-11 00:02:21 +05:30
Thakee Nathees
2bc09f41e5 Stack miss calculation bug fix & minor changes 2022-04-06 08:56:51 +05:30
Thakee Nathees
c3544fb92b A test suite added to test random things. 2022-04-05 02:59:05 +05:30