23 Commits

Author SHA1 Message Date
cron
8843f2e0eb turtle/tlang: numerous fixes for .indexing
Lua interface now supports it
The access/assign functions now use indexing by default
Things that deal with indexed stuff now assume its a table rather than a string
2020-12-11 02:59:40 +00:00
cron
bac0a83110 turtle/tlang: add numerical dot indexing
[1, 2, 3] now you can do .1 to get the 1st element (Lua style 1-indexed)
2020-12-10 04:45:58 +00:00
cron
f54064df07 turtle/tlang: add . map indexing
var.key pushes the value indexed by key in var onto the stack
quotes also work for assignment
numerical keys do not work yet
2020-12-10 04:34:48 +00:00
cron
5bcd04a69a turtle/tlang: make () work
Literally equivalent to {} run
2020-11-13 06:57:54 +00:00
cron
0374b73d97 turtle/tlang: preliminary .key accessing
VAR.key.key = index var[key][key]
.key.key = index TOS[key][key]

The value after . can be just a number.
2020-11-13 06:41:30 +00:00
cron
5f5dcf7195 turtle/tlang: add loop variable to forever 2020-11-08 18:26:01 +00:00
cron
a5f00780ec turtle/tlang: improve API, add more boolean builtins 2020-11-07 19:27:25 +00:00
cron
4c2a89bba9 turtle/tlang: add else to if, fix end of scope error 2020-11-06 17:06:32 +00:00
cron
3a210fef57 turtle/tlang: fix nextpop bug, improve value conversion 2020-11-06 16:20:04 +00:00
cron
cd1805ce25 turtle/tlang: add args builtin
Also fixes some bugs regarding exiting code blocks.
2020-11-06 00:54:06 +00:00
cron
cd0eb1b192 turtle/tlang: add WIP API
Some things aren't _raw, other things are, its WIP
2020-11-06 00:13:21 +00:00
cron
ba9a07d262 turtle: add public domain dedications 2020-11-05 23:20:28 +00:00
cron
4c94ff4390 turtle: add tlang scheduler 2020-11-05 19:13:57 +00:00
cron
91ef7215e7 turtle/tlang: make more modular 2020-11-05 18:58:25 +00:00
cron
f6115ade95 turtle/tlang: remove unecessary dofile replacement 2020-11-05 18:49:45 +00:00
cron
9d6d791073 turtle/tlang: add repeat
{code} count <var> repeat
2020-11-05 06:49:55 +00:00
cron
5dd14439ac turtle/tlang: allow unary operators to assign to quotes, add more operators
`var -- is now possible
Added + - / % !
2020-11-05 03:15:12 +00:00
cron
d3b2d308da turtle/tlang: make = assign to nearest defined
If identifier has never been assigned, assign it in current scope
If it has been assigned, reassign it at that scope to value
Needs a global assignment and local assignment, maybe rename = to set or something
2020-11-05 02:52:48 +00:00
cron
752a72a478 turtle/tlang: add while 2020-11-04 19:19:36 +00:00
cron
d324d9ed10 turtle/tlang: make access() search for newest locals first, globals last 2020-11-04 06:46:43 +00:00
cron
c65e72116e turtle/tlang: add forever and some other builtins
With forever, break, and (basic) if for and while can be made.
2020-11-04 02:57:48 +00:00
cron
957d425609 turtle/tlang: add run builtin
This changes how code is executed a bit, code from the stack is popped to an execution stack before.
This makes global executed functions and anonymous ones identical.
Not super well tested as always :]
2020-11-03 07:06:59 +00:00
cron
d47ce9b310 turtle: add working tlang
Not very well tested, needs a better public API, not integrated with Minetest, ...
This is WAY bigger than a commit should be.
The next stages will be:
- unit tests
- API (allows it to be more than just a language for this project)
- integration with Minetest
2020-11-01 02:55:54 +00:00