Commit graph

18 commits

Author SHA1 Message Date
c4f0f0f721 Interpreter - Fixed special case for init 2023-01-11 08:03:42 +01:00
783a2e3dd0 Interpreter - Special case for initializer methods 2023-01-11 07:46:13 +01:00
16151bd326 Actually made "this" work in the interpreter 2023-01-10 09:03:57 +01:00
542bc56aad Interpreter - Initial implementation of bound methods 2023-01-09 10:50:24 +01:00
d8dba3ac5f Rewrote value storage and implemented class instantiation
* Probably not the last time.
  * Object-like things (functions, classes, etc...) are stored as
    ref-counted cells.
  * Separate data structure for native functions.
  * with_callable() method on value to run specific code on objects
    that are callable
  * Instance type added.
  * Instance construction implemented
2023-01-08 10:40:36 +01:00
85e9c7db38 Interpreter - Callables now receive the callee value as an argument 2023-01-08 07:58:56 +01:00
a89be8632c Missed a rename in previous commit 2023-01-07 09:17:02 +01:00
363cdab86f Interpreter - Fixed closures
* Environment for function execution is now based on their
    declaration.
  * I had missed that part while skimming over the book.
2023-01-07 08:59:13 +01:00
10223cbb4e Interpreter - WIP refactor to prepare for using resolved variables 2023-01-05 07:54:18 +01:00
c5f099340b Errors refactoring - Code compiles. 2023-01-04 07:58:44 +01:00
c8be65dc4c Interpreter - Remove checks for duplicate argument names 2023-01-02 21:49:45 +01:00
db781ed00f HAPPY CLIPPY IS HAPPY!!!! 2023-01-02 21:44:02 +01:00
0ef1318a35 Interpreter - Function name is optional (lambdas...) 2023-01-02 21:37:29 +01:00
d6ea1c3099 Interpreter - Handle return value in functions 2023-01-02 20:46:34 +01:00
cf3284cd88 Interpreter - Handle errors for multiple definitions of an argument 2023-01-02 20:08:05 +01:00
7b20ec2f3a Interpreter - Define functions from name/params/body
* Used to be defined from statement, but this is cleaner and easier
2023-01-02 20:07:15 +01:00
ca3ec46bdc Interpreter - Data structure for functions 2023-01-02 19:50:55 +01:00
e963a9f7ca Interpreter - New submodule for functions 2023-01-02 18:58:20 +01:00