isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Made else statement auto deindent #243

Closed Maltysen closed 6 years ago

Maltysen commented 6 years ago

The else statement .? right now requires you to manually deindent with )'s or ;. However, there is no need to make them deindent that final level, as that is already unambiguous.

I made .? a replacement parse that adds a ) before the else. This lets you do things like IQ1.?2. Even in the case where you want to deindent multiple layers with a ; and then do an else, it only adds an extra blank line, and doesn't add any extra chars: IQVQN;.?_1.

This is a change to .?, not I, so it'll work for all the other control structures else works with.