Blark

Latest version: v0.8.1

Safety actively analyzes 624875 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.8.1

This is a packaging bugfix release.

For details about v0.8.0, see [here](https://github.com/klauer/blark/releases/tag/v0.8.0).

**Full Changelog**: https://github.com/klauer/blark/compare/v0.8.0...v0.8.1

0.8.0

What's Changed

* Fixed support for function call chaining in general expressions beyond just statements (93 / 94)
* Fixed support for indirect specifications with initialization parameters (e.g., `POINTER TO FB_Something(1, 2)`) (85, 95)
* Some initial API [documentation](https://klauer.github.io/blark/) is now available on GitHub Pages
* All transformer (lark grammar -> AST-like) dataclasses now have docstrings and examples (89)
* Dataclass documentation shows the associated Lark grammar rule(s)
* Fixed incorrect escape character for double quotes in double-byte strings (`$"` 86)
* The prototype Sphinx domain is returns to being functional post-solution-loading refactor (87)
* Comment pre-parsing will now include positional metadata (89)
* Preliminary supporting for annotating source code with HTML/XML tags (stylesheets not included) (88)
* Example: `blark format --output-format html FB_ProjectA.TcPOU`
* More test coverage of the grammar and related tools

Grammar

* Added `chained_function_call` grammar rule (`ChainedFunctionCall` dataclass)
* Some unused rules and terminals - vestiges of old blark functionality - were removed
* `structured_var_declaration`, `function_var_decl`, `step_*`
* Added `chained_function_call`
* `chained_function_call_statement` now uses `chained_function_call`

Pull Requests

* Unused grammar rule clean-up and grammar coverage tests by klauer in https://github.com/klauer/blark/pull/86
* FIX: make sphinx domain work again by klauer in https://github.com/klauer/blark/pull/87
* ENH/DOC: docstrings + start of API docs by klauer in https://github.com/klauer/blark/pull/89
* ENH: first pass at html output by klauer in https://github.com/klauer/blark/pull/88
* CI: documentation deployment GitHub Action by klauer in https://github.com/klauer/blark/pull/92
* FIX: function call chaining in expressions by klauer in https://github.com/klauer/blark/pull/94
* FIX: init arguments for pointer type specifications by klauer in https://github.com/klauer/blark/pull/95


**Full Changelog**: https://github.com/klauer/blark/compare/v0.7.1...v0.8.0

0.7.1

What's Changed
* FIX: format failure of 83 by klauer in https://github.com/klauer/blark/pull/84


**Full Changelog**: https://github.com/klauer/blark/compare/v0.7.0...v0.7.1

0.7.0

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

0.6.0

What's Changed

This release includes a number of small-but-important grammar fixes.

* Fixed support for explicit base 10 integer literals (e.g., `1012345`)
* Added an explicit `CONTINUE` statement. This erroneously parsed as a no-op statement previously.
* Added support of chained function-call/method-call statements with new `function_call_statement_list` grammar.
* Added optional dereference (`^`) character to function and method calls (e.g., `uut.call1()^.call2()`)
* Removed `method_statement` to reduce ambiguity, since `method_statement` is a subset of `functional_call_statement`
* Add support for array initializer for `function_block` objects. ([Example](https://github.com/klauer/blark/blob/0cf8bf3de3144acd35d965c609bcf8e51a2d565d/blark/tests/source/array_initializer.st))
* Enhanced `function_block` declaration to support setting structured attributes (`VAR_INPUT` and `VAR_IN_OUT`).

Pull Requests

* FIX: further annotation-related fixes by klauer in https://github.com/klauer/blark/pull/46
* CI: updates to GitHub Actions and pre-commit fixes by klauer in https://github.com/klauer/blark/pull/49
* Feature/add continue statement to grammar by engineerjoe440 in https://github.com/klauer/blark/pull/48
* updated README by engineerjoe440 in https://github.com/klauer/blark/pull/51
* Add Support of Chained Method/Function Calls by engineerjoe440 in https://github.com/klauer/blark/pull/55
* Array Initializer by engineerjoe440 in https://github.com/klauer/blark/pull/56
* Support Dereferenced Function/Method Returns in Grammar by engineerjoe440 in https://github.com/klauer/blark/pull/59
* Support for Explicit Base 10 Integers by engineerjoe440 in https://github.com/klauer/blark/pull/62
* Address Issue with Array-Initialization -- Other General Cleanup by engineerjoe440 in https://github.com/klauer/blark/pull/63

**Full Changelog**: https://github.com/klauer/blark/compare/v0.5.0...v0.6.0

0.5.0

What's Changed
* Enhancement/support recursive pointer to by engineerjoe440 in https://github.com/klauer/blark/pull/33
* Bugfix/Enhancement: Add Support of `bit_string_literal` in CASE Statements by engineerjoe440 in https://github.com/klauer/blark/pull/35
* Enhancements and Fixes Found While Testing Code Base by engineerjoe440 in https://github.com/klauer/blark/pull/36
* Add Support of VAR_EXTERNAL in Functions
* Allow DateTimes to exclude seconds/fractional-seconds
* Support Arrays of FunctionBlocks that use an FB_init inline
* Allow "Stray" semicolons that would otherwise have no effect
* Allow Namespaced (dotted) access to structures in declarations when setting a default.
* Separate Global Variable Attributes to allow inclusion of "INTERNAL"
* Fix function call handling of empty arguments
* Refactor/enhancement: better CLI handling of non-TwinCAT files by klauer in https://github.com/klauer/blark/pull/37
* Bugfix: small regression after IndirectionType adjustments of 33 by klauer in https://github.com/klauer/blark/pull/38
* Maintenance: test coverage and dropping support for lark < 1.0 by klauer in https://github.com/klauer/blark/pull/39
* CI: code coverage via pytest-cov and codecov by klauer in https://github.com/klauer/blark/pull/40
* Maintenance/tests: Move existing example to test suite + remove invalid one by klauer in https://github.com/klauer/blark/pull/41
* Bugfix: miscellaneous transformer fixes to get JSON serialization working by klauer in https://github.com/klauer/blark/pull/42
* Test suite: fix source file naming in test suite by klauer in https://github.com/klauer/blark/pull/45


**Full Changelog**: https://github.com/klauer/blark/compare/v0.4.0...v0.5.0

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.