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
4425b27b52
Make overloading code a utility function and call from interpreter.
...
This fixes #10 .
2018-09-13 16:09:04 -07:00
5617484aff
Make parsing function public.
...
libab already provides a _run_tree ... you can't run_tree if there's
no tree.
2018-09-12 14:43:43 -07:00
c4a7117704
Ensure operator does not try to take ownership of string.
2018-08-22 17:45:45 -07:00
f4ecb82c46
Intermediate commit before visitor refactor.
2018-08-11 18:22:18 -07:00
4a058384c1
Make some functions public.
2018-08-10 18:39:26 -07:00
fdca2a8ca7
Add more sanitizing characters.
2018-08-10 16:54:39 -07:00
7c8c547540
Add true / false values to interpreter.
2018-08-10 15:29:56 -07:00
25f5d3469b
Add a boolean type.
2018-08-10 00:52:12 -07:00
03577269f2
Add various ways to call code.
2018-06-21 17:06:53 -07:00
7dfc55154e
Require scope in interpreter calls.
2018-06-21 16:11:39 -07:00
827dba9013
Add the libab prefix to free functions.
2018-06-17 19:43:18 -07:00
f83b7d169c
Resolve function types when they're created.
2018-06-17 19:01:15 -07:00
88ec979ba5
Add scope modes instead of a flag.
2018-06-17 01:25:41 -07:00
695fbed235
Put free functions into common header / source file.
2018-06-15 22:54:58 -07:00
62dd41e634
Use the unit type correctly instead of null references.
2018-06-02 16:06:13 -07:00
8207f1f450
Add unit value to interpreter.
2018-06-02 15:59:13 -07:00
969e457fba
Add a unit type.
2018-06-02 15:37:04 -07:00
b7cc17d394
Remove debug printing.
2018-06-02 15:17:43 -07:00
f199bc6efd
Add a function to call a function by name.
2018-06-01 23:32:19 -07:00
5fec3bd63c
Make operators simply aliases to functions.
2018-06-01 15:24:55 -07:00
6cc43449c5
Clear root scope on free to prevent internal function circular refs.
2018-05-31 19:45:36 -07:00
34b97e42ac
Add scopes to functions.
2018-05-28 01:18:06 -07:00
1f8788dd32
Add functions for getting special types.
2018-05-27 00:11:00 -07:00
f4de244c41
Format code.
2018-05-26 21:55:30 -07:00
a6029d7ef4
Add utility function for executing code.
2018-05-18 14:15:15 -07:00
c3a7657c71
Format code.
2018-05-17 14:53:48 -07:00
97543a3d19
Remove unused nesting in behavior struct.
2018-05-16 23:10:33 -07:00
47a57d66ee
Remove types from behavior structs.
2018-05-16 15:26:03 -07:00
48f8d09405
Make table searching functions public to prevent their duplication.
2018-05-16 14:05:35 -07:00
70e0e75d24
Switch to using values for storing function entries.
2018-05-14 21:32:36 -07:00
3e8c814215
Remove pointless parameter copying.
2018-05-11 20:36:27 -07:00
989774cec5
Add methods to get pointers to basetypes, for comparison.
2018-05-11 20:12:03 -07:00
8253cd1f69
Add initialization functions for operators and functions.
2018-05-09 15:05:40 -07:00
3b0908125d
Avoid creating number type reference in interpreter.
2018-05-06 19:01:47 -07:00
1e215ecfa5
Add a function for preparing for execution.
2018-05-06 18:45:07 -07:00
0a24fff344
Add a new implementation struct with only one function.
2018-04-24 16:59:53 -07:00
14e9ddea23
Remove the implementation struct.
2018-04-24 16:34:10 -07:00
46040531fb
Add interpreter to libab.
2018-04-24 11:35:27 -07:00
a86938b574
Use reference counted table in libab.
2018-04-24 11:35:16 -07:00
5d3130d39d
Format the code with clang-format.
2018-04-21 14:09:01 -07:00
30578f27da
Take precompiled type in register functions. User must call create_type.
2018-04-20 14:54:58 -07:00
7692d4541f
Add function to compile a type from its string.
2018-04-20 14:54:23 -07:00
8214aa8344
Allow tree-based function implementations.
2018-04-20 09:26:18 -07:00
3ada78a557
Use reference counting for types.
2018-04-17 22:14:28 -07:00
7b1445a262
Add functions for basetypes and their entries in tables.
2018-04-17 12:07:22 -07:00
9500a6f9b0
Make a single "operator" token, and specialize after parse.
2018-03-17 20:56:25 -07:00
6b438dbc6d
Store the operator type in the corresponding table entry.
2018-03-17 17:38:13 -07:00
27acfb0be7
Register reserved operators as tokens.
2018-03-16 23:09:11 -07:00
ab2311def9
Store function / operator types when they are registered.
2018-03-15 19:41:11 -07:00