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

Add Support of Chained Method/Function Calls #55

Merged

Conversation

engineerjoe440
Copy link
Collaborator

Issues Addressed

Changes

  • Add support of chained function-call/method-call statements with new function_call_statement_list grammar.

Closing Thoughts

I think this is a fairly reasonable way to address this item, but I'm very open to comments or suggestions. I think it's possible to combine the original function_call_statement and this new function_call_statement_list but I left the original one for consistency sake. Let me know what you think!

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

Merging #55 (5169bdc) into master (f423b1b) will increase coverage by 0.5%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #55     +/-   ##
========================================
+ Coverage    71.8%   72.4%   +0.5%     
========================================
  Files          18      18             
  Lines        3772    3783     +11     
========================================
+ Hits         2710    2739     +29     
+ Misses       1062    1044     -18     
Impacted Files Coverage Δ
blark/tests/test_transformer.py 100.0% <ø> (ø)
blark/transform.py 98.9% <100.0%> (+<0.1%) ⬆️

... and 2 files with indirect coverage changes

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.

This looks really good, @engineerjoe440!

The test cases, the grammar update, and the transformer class are all 👍
One little nitpick, a minor fix, and we can merge this in.

blark/transform.py Outdated Show resolved Hide resolved
blark/iec.lark Outdated
@@ -722,6 +722,7 @@ _statement: ";"
| reset_statement
| reference_assignment_statement
| return_statement
| function_call_statement_list
Copy link
Owner

Choose a reason for hiding this comment

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

I'll be a bit nitpicky here with naming - how about chained_function_call_statement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had very strongly considered that! 😆 I thought that maybe I'd stick with "list" just because that felt more in-line with other things, but I'm for it! I'll make that change...

@klauer klauer linked an issue Apr 7, 2023 that may be closed by this pull request
@klauer klauer merged commit c6e0e18 into klauer:master Apr 7, 2023
@klauer
Copy link
Owner

klauer commented Apr 7, 2023

Thanks!

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.

Add Support for Multi-Line Object Oriented Function-Block Usage
3 participants