-
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
Method implementations 1: Variable references #253
Conversation
ulmer-a
commented
Aug 18, 2021
- Let method implementations reference member variables of the containing class
Codecov Report
@@ Coverage Diff @@
## master #253 +/- ##
==========================================
+ Coverage 94.83% 94.89% +0.05%
==========================================
Files 41 42 +1
Lines 10926 11137 +211
==========================================
+ Hits 10362 10568 +206
- Misses 564 569 +5
Continue to review full report at Codecov.
|
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.
I'm not sure on how to really get information on my parent POU. Neither indexing nor annotating is performed hierarchically, so only the name of our POU tells us whether it has a parent an where it can be located. Is this a legitimate approach?
Ok I'm adding an Option in Pou which denotes the associated class for a given Method.
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.
@riederm Very nice and readable code in resolver.rs
. Pleasure to work with.
The changes in the data type generator have nothing to do with the actual changes of this PR. It's just some refactoring to make clippy happy (there was some function with ~10 arguments).
I'll add some more tests soon.
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.
The resolution/declaration is looking good.
We are missing some tests (and functionality) regarding method calls, I will upload them soon.
Basically the codegen does not pass the method parameters to the call.
I will also add some correctness tests.
I uploaded failing tests |
Since I did the last few modifications I would prefer @riederm to review this. |
dont store an optional associated_class in the AST implementation, but store the classname inside the pouType variant "Class"
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.
ill upload the changes