11 Commits

Author SHA1 Message Date
cron
a0434a7225 turtle: add tlang scheduler 2021-08-28 23:12:29 -05:00
cron
0753b8d94d turtle/tlang: make more modular 2021-08-28 23:12:29 -05:00
cron
2ca6d7ef31 turtle/tlang: remove unecessary dofile replacement 2021-08-28 23:12:29 -05:00
cron
4c816f1071 turtle/tlang: add repeat
{code} count <var> repeat
2021-08-28 23:12:29 -05:00
cron
05da1be543 turtle/tlang: allow unary operators to assign to quotes, add more operators
`var -- is now possible
Added + - / % !
2021-08-28 23:12:29 -05:00
cron
e5f28d8469 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
2021-08-28 23:12:29 -05:00
cron
48da01beb5 turtle/tlang: add while 2021-08-28 23:12:29 -05:00
cron
8e757040bf turtle/tlang: make access() search for newest locals first, globals last 2021-08-28 23:12:29 -05:00
cron
0f8dd9c7f3 turtle/tlang: add forever and some other builtins
With forever, break, and (basic) if for and while can be made.
2021-08-28 23:12:29 -05:00
cron
d791294319 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 :]
2021-08-28 23:12:29 -05:00
cron
7f09824e89 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
2021-08-28 23:01:49 -05:00