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

Array initializer from TwinCAT documentation fails to parse #44

Closed klauer closed 1 year ago

klauer commented 2 years ago

From https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/2530335371.html&id=

PROGRAM MAIN
VAR
    fbSample  : FB_Sample(nInitParam := 1) := (nInput := 2, nMyProperty := 3);
    aSample   : ARRAY[1..2] OF FB_Sample[(nInitParam := 4), (nInitParam := 7)]
                            := [(nInput := 5, nMyProperty := 6), (nInput := 8, nMyProperty := 9)];
END_VAR
END_PROGRAM

This odd syntax is explained later in the linked documentation page.

engineerjoe440 commented 1 year ago

Looks like I've run into this in the wild, too... haha! I'm going to start seeing if I can poke around and come up with any solutions. :smile: