14 Commits

Author SHA1 Message Date
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
9fd49d876b turtle/tlang: force beginning and end of string literals to match 2020-11-04 19:20:02 +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
9f8aa05b50 turtle/tlang: fix copying error with = builtin 2020-11-04 03:03:53 +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
03389880af turtle/tlang: add comments, fix strings
Strings support '' syntax now. They can also be started with ' and ended with " or vice versa, and there is no way to put a literal ' in yet.
2020-11-04 02:55:08 +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
0a3d331680 turtle/tlang: fix lexer whitespace issues
This fixes the final whitespace issue as well as numbers requiring a final whitespace.
Maps don't need surrounding whitespace anymore.
2020-11-03 07:05:27 +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
cron
0f420b14ac turtle: some weird ideas before the turtle language is added 2020-10-30 23:00:40 +00:00
cron
2d4aa9c9c1 turtle: add preliminary scheduling system 2020-10-15 21:28:14 +00:00
cron
68401ec791 turtle: initial turtle mod
Don't use turtle.quarry or the mining features, they are experimental
2020-10-14 13:00:32 +00:00