Skip to content
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

Bugfix/Enhancement: Add Support of bit_string_literal in CASE Statements #35

Conversation

engineerjoe440
Copy link
Collaborator

Changes:

  • Add bit_string_literal to list of case_list_elements
  • Add test of CASE with BYTE#...
  • Add source file to verify CASE in context.

Issues Addressed:

Closing Thoughts:

This still may be better enhanced by including boolean_literal, but I'm not quite sure of that.

Copy link
Owner

@klauer klauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing. Thanks for catching this and the fix!

This still may be better enhanced by including boolean_literal, but I'm not quite sure of that.

If Codesys/TwinCAT allow for it, blark should support it - that's my take as you know. It'd be weird to use a CASE statement when an IF statement is sufficient for a boolean check, but it wouldn't surprise me if it were valid given the other things in the language...

blark/iec.lark Show resolved Hide resolved
@engineerjoe440
Copy link
Collaborator Author

I think this should be ready for another pass at your leisure. 😄

Copy link
Owner

@klauer klauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @engineerjoe440!

blark/tests/test_transformer.py Show resolved Hide resolved
@engineerjoe440
Copy link
Collaborator Author

Thanks @klauer, should be ready with the new test!

@klauer
Copy link
Owner

klauer commented May 13, 2022

GitHub won't let me give bonus points for extra effort - so an emoji will have to suffice: 🎉

Thanks!

@klauer klauer merged commit 435dd21 into klauer:master May 13, 2022
@engineerjoe440 engineerjoe440 deleted the bugfix/address-commas-in-case-statement-failure branch May 13, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants