Commit Graph

53 Commits

Author SHA1 Message Date
Danila Fedorin ca6075e8d5 Add a new method call operator, and more.
The '.' operator now represents method calls. A function f: (a, b)->c
can be called as a.f(b), which is equivalent to f(a, b). Besides
this change, all reserved operators now have a negative precedence
(it's relative, remember?), and some function names were changed.
2018-09-13 17:05:39 -07:00
Danila Fedorin 4425b27b52 Make overloading code a utility function and call from interpreter.
This fixes #10.
2018-09-13 16:09:04 -07:00
Danila Fedorin 3d0e4776fc Fix bugs related to partial application types. 2018-08-11 22:26:11 -07:00
Danila Fedorin f4ecb82c46 Intermediate commit before visitor refactor. 2018-08-11 18:22:18 -07:00
Danila Fedorin 71b6092654 Implement do ... while. 2018-08-10 20:06:02 -07:00
Danila Fedorin 0824dee594 Add a while loop. 2018-08-10 19:16:47 -07:00
Danila Fedorin b0c2eb5a5e Maintain the promise that references are null-ed on error. 2018-08-10 17:31:02 -07:00
Danila Fedorin d0615d2c3e Implement the if statement. 2018-08-10 16:34:28 -07:00
Danila Fedorin 3b79b5751a Add true and false keywords to the parser. 2018-08-10 16:06:30 -07:00
Danila Fedorin 7c8c547540 Add true / false values to interpreter. 2018-08-10 15:29:56 -07:00
Danila Fedorin 6b331cc3c4 Report error code from function call. 2018-06-22 00:44:59 -07:00
Danila Fedorin 48300cd86e Implement reserved operators. 2018-06-21 19:00:45 -07:00
Danila Fedorin 7dfc55154e Require scope in interpreter calls. 2018-06-21 16:11:39 -07:00
Danila Fedorin 13ccea10e4 Add scope to internal functions. 2018-06-21 14:25:11 -07:00
Danila Fedorin 827dba9013 Add the libab prefix to free functions. 2018-06-17 19:43:18 -07:00
Danila Fedorin f83b7d169c Resolve function types when they're created. 2018-06-17 19:01:15 -07:00
Danila Fedorin b9b6a8ec4b Get basetype from table or type parameters if not resolved. 2018-06-17 18:20:40 -07:00
Danila Fedorin 05586069a7 Remove function resolving code. It will not be used. 2018-06-17 17:13:11 -07:00
Danila Fedorin 22b738a4f0 Add code to call tree functions. 2018-06-17 02:03:34 -07:00
Danila Fedorin 88ec979ba5 Add scope modes instead of a flag. 2018-06-17 01:25:41 -07:00
Danila Fedorin 763cfdd7a3 Search scope as well as type map for type parameters. 2018-06-17 00:12:51 -07:00
Danila Fedorin 065554bcdf Store type parameters into table during call. 2018-06-16 23:40:32 -07:00
Danila Fedorin 28f7cd1b30 Add creating tree functions. 2018-06-15 22:56:56 -07:00
Danila Fedorin 695fbed235 Put free functions into common header / source file. 2018-06-15 22:54:58 -07:00
Danila Fedorin 59f306f59e Avoid hard crashes due to unfinished interpreter function. 2018-06-13 23:28:33 -07:00
Danila Fedorin 1438690b62 Add a partial application function. 2018-06-03 00:49:30 -07:00
Danila Fedorin 62dd41e634 Use the unit type correctly instead of null references. 2018-06-02 16:06:13 -07:00
Danila Fedorin 8207f1f450 Add unit value to interpreter. 2018-06-02 15:59:13 -07:00
Danila Fedorin 0db929b7f7 Fix functions remaining allocated after program exit. 2018-06-02 12:42:06 -07:00
Danila Fedorin f199bc6efd Add a function to call a function by name. 2018-06-01 23:32:19 -07:00
Danila Fedorin 5fec3bd63c Make operators simply aliases to functions. 2018-06-01 15:24:55 -07:00
Danila Fedorin b0a25fd53f Add comments to the various function calling functions.
There are a lot of them, and they're fairly arcane.
2018-05-27 18:09:28 -07:00
Danila Fedorin 99c36be175 Free temporary parameters. 2018-05-27 14:05:51 -07:00
Danila Fedorin 1f7294ce29 Add libabacus parameter to function calls. 2018-05-27 00:02:20 -07:00
Danila Fedorin f4de244c41 Format code. 2018-05-26 21:55:30 -07:00
Danila Fedorin a6aaa22450 Add calling operators. 2018-05-26 20:43:36 -07:00
Danila Fedorin 280bc60da4 Generalize type checking function in preparation for operators. 2018-05-26 19:27:27 -07:00
Danila Fedorin a117d7854b Add calling into the interpreter's tree code. 2018-05-26 15:58:06 -07:00
Danila Fedorin fb55e20e84 Add utilities to reuse common internal function code. 2018-05-26 15:04:28 -07:00
Danila Fedorin 88b32ef58d Add function to call function, instead of function list. 2018-05-26 15:03:57 -07:00
Danila Fedorin 9db667dcdf Fix bugs in the call implementation. 2018-05-22 20:16:06 -07:00
Danila Fedorin 1cd7f3f45a Finish the draft implementation. 2018-05-22 17:45:32 -07:00
Danila Fedorin 070dc179ff Add beginnings of function calling code. 2018-05-22 15:21:10 -07:00
Danila Fedorin c3a7657c71 Format code. 2018-05-17 14:53:48 -07:00
Danila Fedorin cf3136a237 Switch values to having their data refcounted separately.
This allows for values to be "cast" and have a different type, while
still referencing the same data.
2018-05-14 17:41:41 -07:00
Danila Fedorin 3e8c814215 Remove pointless parameter copying. 2018-05-11 20:36:27 -07:00
Danila Fedorin 3b0908125d Avoid creating number type reference in interpreter. 2018-05-06 19:01:47 -07:00
Danila Fedorin c46b82584d Add a new code branch for numbers and void values. 2018-04-24 18:29:17 -07:00
Danila Fedorin 0a24fff344 Add a new implementation struct with only one function. 2018-04-24 16:59:53 -07:00
Danila Fedorin 14e9ddea23 Remove the implementation struct. 2018-04-24 16:34:10 -07:00