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

Dereferenced Variables in Function Calls Not Parsing Correctly #57

Closed engineerjoe440 closed 1 year ago

engineerjoe440 commented 1 year ago

Found yet another little oddity while working through some "in-the-wild" ST code. In the segment below, the GetTagName()^ does not parse correctly. There seems to be an error handling that little ^ dereference in this context. 😕

Something := anObject.WriteLine(THIS^.something.t, THIS^.GetTagName()^, INT_TO_STRING(BOOL_TO_INT(THIS^.someAttribute)));

I hope that early next week I can start investigating this more closely!

engineerjoe440 commented 1 year ago

Well, shucks... 😆 I've got something that might address this, but haven't gotten around to getting a PR up for it yet. Sorry about that... Hopefully I'll get another chance to re-review my changes and get a PR up. Here's my working branch, FWIW: https://github.com/engineerjoe440/blark/tree/bugfix/dereferenced-method-return