What's Changed
This release includes a major rework of TwinCAT solution file loading, the blark CLI tool, and a number of grammar-related fixes.
* `INTERFACE` definitions are now supported. (73) The solution loader can load these `.TcIO` files directly.
* Add support for the [`JMP`](https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/2528307851.html&id=) statement (#79)
* Grammar fixes for the following:
* Arrays of arrays in type declarations and initialization (e.g., `fValue : ARRAY [1..10] OF ARRAY [1..10] OF INT;`) (66)
* Code with identifiers starting with `Return` or `Continue` will no longer be mistaken for statements of the same name (68)
* String lengths may now be expressions (e.g., `STRING(g_Constant + 1) := 'abc'`) (72)
* Expressions in initial array elements are no longer limited to constants (e.g., `currentChannel : ARRAY[1..g_c_someConstant] OF POINTER TO struct_groupData := [ ADR(_object[1].someValue) ];`) (74)
* Removed support for power expression (`**`) which is invalid in TwinCAT-flavor ST (76)
* A new TwinCAT solution loader (`.sln`, `.tsproj`, `.TcPOU`, etc.) was added to blark with a goal of making file loading more easily customizable, with the option to load/save arbitrary file formats. (64)
* The implementation is preliminary and subject to change (as is everything in blark).
* blark continues to support the current input formats (plain text `.st` files, and TwinCAT source code files)
* Removed the dependency on pytmc (for code loading, the dependency store, and everything else).
* New requirement, lxml, for project parsing.
* Allow for mapping of blark input line numbers back to source code files. Input files may now correspond to one or more different grammar rules (e.g., a `TcPOU` `FUNCTION_BLOCK` that contains declaration, an implementation, and any number of `METHOD` / `ACTION` / `PROPERTY` sub-items).
* Allow for in-place code rewriting of source code files (`blark format --write my_pou.TcPOU`)
* Rework of user-facing parsing API to use a [consistent dataclass](https://github.com/klauer/blark/blob/3e1a54378b4fe55ffe895017e0c805a09c7e478c/blark/parse.py#L92). (64)
* This groups together the source code, a map of line numbers, the raw `lark.Tree`, and an option to easily transform it into `blark.transform` dataclasses to allow for code rewriting, reformatting, summarization, and so on.
* Rework of the `blark parse` CLI. See `blark parse --help` for more details.
* Rework of the `blark format` CLI to support the new input/output file handling. See `blark format --help` for more details.
Pull Requests
* Support arrays of arrays by engineerjoe440 in https://github.com/klauer/blark/pull/66
* Resolve RETURN and CONTINUE Overly-Greedy Matching by engineerjoe440 in https://github.com/klauer/blark/pull/68
* FIX: string length expression by klauer in https://github.com/klauer/blark/pull/72
* REF/ENH: standalone solution parser and rewrite of input/output format support by klauer in https://github.com/klauer/blark/pull/64
* FIX/CLN: remove unsupported power_expression by klauer in https://github.com/klauer/blark/pull/76
* FIX: Bugfix for expressions in initial array elements by klauer in https://github.com/klauer/blark/pull/74
* ENH: interface support by klauer in https://github.com/klauer/blark/pull/73
* ENH: first pass at JMP and labeled statements by klauer in https://github.com/klauer/blark/pull/79
* FIX: ignore global text list project files by klauer in https://github.com/klauer/blark/pull/81
**Full Changelog**: https://github.com/klauer/blark/compare/v0.6.0...v0.7.0