Java but stack-based and more cursed
Javastack has three types of tokens:
- Numeric literals, marked by a string of digits
- String literals, marked by a string of characters in between
"
- Commands, a string of letters.
The commands are all available in elements.md
.
It also has several constructs, such as loops, conditionals, etc:
twice
,thrice
,four
andfive
loops evaluate the code within them said amount of timestimes
loops pop the stack, and loop that many timesforever
loops run foreverforeach
loops iterate over each item of a list or string (item is currently inaccessible), using the current stack - This has actually been implemented now!while
loops pop the stack at every iteration and check that that is truthymap
iterates over each value of a list or string in its own stack, popping it at the end to return a value and modify the existing valueif
pops the stack and runs the code between it and anelse
orend
if the popped value is truthyelse
can only go after anif
, and runs the code between it and anend
if the popped value of theif
is falsyend
closes any structure