@user sure, why not. In fact, here's an idea: Why don't we have both golfy and readable syntax for everything, and you can use whichever one you want, even mixing them together? That sounds like it could make for some pretty cursed programs. :)
But we need the readable syntax to still be cursed, so it can't just be while, switch, case, etc. Any ideas?
I bags implementing pattern matching - it's something I've wanted to do for one of my own languages, and I think it'll be quite fun
About the parser, how about making multiple functions that either return an AST along with the rest of the code to be parsed OR a falsey value if it couldn't be parsed?
Or some kind of message: "Excepted ";" at index 69.0" (misspelling and decimal just to screw with the user)
@user Also, what we could do is make it so that you could use e.g. 1 or "hello" as literals for the cases, or you could use e.g. (var*3) as expressions for the cases, or e.g. /he*ld!/ as regexes for the cases.
@user sure, I have no idea how to do that anyway :P
@AaronMiller Actually, I guess that would be pretty useful. Let's just stick with the pattern matching switches like you suggested, and you can implement those.
In this case, the switch statement is indented, and the loop is terminated by either EOF or the Did keyword, which acts as the end bracket of the loop, meaning you could goto out of the loop and do stuff until you hit a Did. You could even goto out of the loop and hit the opening statement of the loop, essentially nesting it inside of itself!
Also, for the default cases in the switch, the any is just a variable equal to *, or whatever the equivalent is in our regex implementation.
The During...Did loop is essentially a shorthand for :label:...if(stuff){goto ;label;}, but it is much simpler than just doing the label thing since the loop has that whole "confirm that we actually wanted to break the loop" thing, which would be very verbose to implement with switch statements and gotos.