26 Commits

Author SHA1 Message Date
cron
da090876a4 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
2021-08-28 23:25:59 -05:00
cron
42a253cc71 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
2021-08-28 23:25:59 -05:00
cron
ff4c79f16d turtle/tlang: improve in_keys()
The function references should probably be replaced with the Lua-y form
2021-08-28 23:12:53 -05:00
cron
75435d73f9 turtle: fix pausing 2021-08-28 23:12:30 -05:00
cron
434de43a72 turtle/tlang: add loop variable to forever 2021-08-28 23:12:30 -05:00
cron
78d66a7125 turtle/tlang: add state pausing 2021-08-28 23:12:29 -05:00
cron
e77a5f9e83 turtle/tlang: improve API, add more boolean builtins 2021-08-28 23:12:29 -05:00
cron
f1dfe28848 turtle/tlang: fix binary operators being backwards 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
4be2c31314 turtle/tlang: add boolean conversion API, improve automatic conversion 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
33505596ed turtle: add .tlang, fix print log 2021-08-28 23:12:29 -05:00
cron
6e8c1fb739 turtle/tlang: log prints 2021-08-28 23:12:29 -05:00
cron
632eb7e286 turtle: fix tlang integration 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
ac9f18f6dd turtle/tlang: fix copying error with = builtin 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