klauer / blark

Beckhoff TwinCAT ST (IEC 61131-3) code parsing in Python using Lark (Earley)
https://klauer.github.io/blark/
GNU General Public License v2.0
42 stars 5 forks source link

Support Dereferenced Function/Method Returns in Grammar #59

Closed engineerjoe440 closed 1 year ago

engineerjoe440 commented 1 year ago

Related Issues

Changes

Closing Thoughts

These changes should make this all a bit more convenient, and should allow for syntax such as:

uut.call1()^.call2(A := 1).call3(B := 2)^.call4().done();

Which can allow for chained method calls using dereferences on any returned pointers.

codecov-commenter commented 1 year ago

Codecov Report

Merging #59 (f214d07) into master (8988e2e) will increase coverage by 0.3%. The diff coverage is 100.0%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/klauer/blark/pull/59/graphs/tree.svg?width=650&height=150&src=pr&token=QZDTKF30TH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer)](https://codecov.io/gh/klauer/blark/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer) ```diff @@ Coverage Diff @@ ## master #59 +/- ## ======================================== + Coverage 72.3% 72.6% +0.3% ======================================== Files 18 18 Lines 3797 3806 +9 ======================================== + Hits 2746 2764 +18 + Misses 1051 1042 -9 ``` | [Impacted Files](https://codecov.io/gh/klauer/blark/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer) | Coverage Δ | | |---|---|---| | [blark/tests/test\_transformer.py](https://codecov.io/gh/klauer/blark/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer#diff-YmxhcmsvdGVzdHMvdGVzdF90cmFuc2Zvcm1lci5weQ==) | `100.0% <ø> (ø)` | | | [blark/transform.py](https://codecov.io/gh/klauer/blark/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer#diff-YmxhcmsvdHJhbnNmb3JtLnB5) | `99.0% <100.0%> (+<0.1%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://codecov.io/gh/klauer/blark/pull/59/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K+Lauer)