Skip to content

v0.7.0

Compare
Choose a tag to compare
@klauer klauer released this 16 Aug 18:13
· 29 commits to master since this release
3e1a543

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 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. (#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 #66
  • Resolve RETURN and CONTINUE Overly-Greedy Matching by @engineerjoe440 in #68
  • FIX: string length expression by @klauer in #72
  • REF/ENH: standalone solution parser and rewrite of input/output format support by @klauer in #64
  • FIX/CLN: remove unsupported power_expression by @klauer in #76
  • FIX: Bugfix for expressions in initial array elements by @klauer in #74
  • ENH: interface support by @klauer in #73
  • ENH: first pass at JMP and labeled statements by @klauer in #79
  • FIX: ignore global text list project files by @klauer in #81

Full Changelog: v0.6.0...v0.7.0