-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support else if
#58
Support else if
#58
Conversation
parser/parser.go
Outdated
|
||
ifElseExp.Block = p.parseBlockStatement() | ||
|
||
expression.ElseIf = append(expression.ElseIf, ifElseExp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is the same as the original IF, and can be extracted to a new func, to keep it DRY.
Just a random thought: since plush syntax is mostly inspired by That way, we still can use |
Honestly I never liked that elsif syntax. I would rather else if, personally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it’s good. Clean it up a bit, and it’s a good solid contribution. Thanks.
I agree, I don't like the I will clean up the PR, thanks for your feedback 🙌 |
And also the reason for choosing |
That's a valid point. :) |
9ff5d84
to
ed30d28
Compare
I cleaned up the PR. Woud love to get your feedback again :) |
Rebased the PR with latest master. Is there anything that needs to be done before we can merge this? Please let me know, Happy to make more changes :) |
Love this! Thank you! |
To learn more about Go I thought it would be cool to implement
else if
support.What do you think about this approach?
Codeclimate is failing, but I can fix that later if I know I'm on the right track.