Just updated to v0.2.5e, and found that it breaks a number of my tweetcarts.
The issue specifically seems to be that this shortcut is no longer supported:
if(...)do --thing1 --thing2 --etc. end |
Now to make things work, I have to replace the "do" with "then". Not a huge change, but it does require a couple more characters, and every one counts when dealing with strict character limits.
abusing the single line if to execute a multi-line statement? Bold 😜
Well, I saw somebody else saying it worked, I just followed their lead. ;)
what was the problem with "DO" statment. it felt reasonable AND readable. why change...
it’s not that do
was changed, but that the single-line if(condition) stuff
is now implemented in a more robust way than before, and that has consequences on this hack.
I agree with @JadeLombax. The new version should support all the nifty little shortcuts everyone has found - unless there is a strong reason not to. Gold star to support, @zep.
And I rather like the idea of being able to create a repeat loop within a comparison.
I would actually posit that this is a bug. Technically, in most languages, you can extend a single-line statement by starting a multi-line block.
Hey @zep, can the parser detect a 'do' and then read until its 'end' instead of the eol?
Actually, I imagine you could just detect the 'do' as the first thing after the parens and parse it as a 'then'. Although that would be a cheap shortcut that would only work on the first 'do', whereas a robust fix would be to let any 'do' on the line stop triggering the 'if()...eol' behavior until its associated 'end'.
[Please log in to post a comment]