Ok, so I think this one is much simpler than the title may suggest, but it's the use-case I found this issue with, so I'm going to run with its full complexity for the sake of testing. Here's a snippet that seems to fail:
FUNCTION_BLOCK class_SomethingCool
VAR
currentChannel : ARRAY[1..g_c_someConstant] OF POINTER TO struct_groupData :=
[ ADR(_object[1].someValue),
ADR(_object[2].someValue),
ADR(_object[3].someValue),
ADR(_object[4].someValue),
ADR(_object[5].someValue),
ADR(_object[6].someValue),
ADR(_object[7].someValue),
ADR(_object[8].someValue),
ADR(_object[9].someValue),
ADR(_object[10].someValue)
];
END_VAR
END_FUNCTION_BLOCK
With the following pytest exception (shortened significantly):
E lark.exceptions.UnexpectedCharacters: No terminal matches '[' in the current parser context, at line 4 col 36
E
E [ ADR(_object[1].someValue),
E ^
E Expected one of:
E * HASH
E * LPAR
E * COMMA
E * RPAR
E * ASSIGNMENT
C:\Python311\Lib\site-packages\lark\parsers\xearley.py:119: UnexpectedCharacters
Ok, so I think this one is much simpler than the title may suggest, but it's the use-case I found this issue with, so I'm going to run with its full complexity for the sake of testing. Here's a snippet that seems to fail:
With the following
pytest
exception (shortened significantly):Development branch is here: https://github.com/engineerjoe440/blark/tree/bugfix/advanced-array-development Clearly, I've added a simple sanity-check test, but haven't completed a fix, yet. May not have a chance until later this week at the earliest.