18 Commits

Author SHA1 Message Date
cron
434de43a72 turtle/tlang: add loop variable to forever 2021-08-28 23:12:30 -05:00
cron
e77a5f9e83 turtle/tlang: improve API, add more boolean builtins 2021-08-28 23:12:29 -05:00
cron
88c675193a turtle/tlang: add else to if, fix end of scope error 2021-08-28 23:12:29 -05:00
cron
b7793dbb9a turtle/tlang: fix nextpop bug, improve value conversion 2021-08-28 23:12:29 -05:00
cron
7b3ebdb460 turtle/tlang: add args builtin
Also fixes some bugs regarding exiting code blocks.
2021-08-28 23:12:29 -05:00
cron
627c7d9bcb turtle/tlang: add WIP API
Some things aren't _raw, other things are, its WIP
2021-08-28 23:12:29 -05:00
cron
e30c012771 turtle: add public domain dedications 2021-08-28 23:12:29 -05:00
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