All important changes will be described in this file. Or rather I will try to document them here.
This release does not contain any significant changes in how formatter works,
but it is important as a first step in refactoring and restructuring
that should lead to a more sophisticated tool. Main change is that parser that
previously was maintained as a separate crate moparse
is now a module of
mofmt
.
The release itself is created mainly because the previous one was 10 months ago, and some fixes were introduced in the meantime.
- add support for blank lines in block equations/statements (#48)
- fix error of inserting unnecessary spaces in inheritance modifiers (#46)
- fix parser error when parsing block comments with additional '*'chars
- remove error occuring when first function output is dropped
- fix class annotation indentation in empty classes
This release is probably the last that introduces any significant changes to the produced output.
It brings back the previous, better, approach to line wrapping inside expressions. From now on expressions like arithmetical, logical etc. can only be wrapped manually, and mofmt only ensures that the wrapped expression is nicely indented.
Moreover, mofmt no longer allows wrapping of output-expression-list rule in the similar fashion as function args etc. It looked strange when they included discarded outputs.
With this release mofmt supports the check mode option, so it can be used as a part of CI pipelines.
- check mode (
--check
)
- expressions wrapped at binary operators are indented only once, and wrapping is not applied automatically to remaining operators
- line wrapping in output-expression-list
- fix incorrect indent of "class" annotations that follow section
keywords like
algorithm
- fix the bug that caused mofmt to panic in element redeclared as
replaceable
- fix the issue of changed line endings when mofmt was used on Windows
- mofmt no longer inserts a blank line before the
within
This release marks an important milestone. From now on mofmt
will be
implemented in Rust. The migration was motivated by very poor
performance of Python implementation. This was caused partially by the
ANTLR parser having a general runtime that couldn't be tailored in any
way, and mainly because of the inherent slowness of Python.
New Rust implementation was around 50x faster. After including better and more detailed heuristics it is still between 30-40x faster without any performance tweaks. This both creates significant performance savings that can be spent in the future on more advanced features like HTML formatting, and opens possibilities of performance gains through multithreading etc.
Few long existing bugs were fixed along the way. There are some minor
changes in the style applied by mofmt
. Refer to the code-style.md
.
- support for new syntactical constructs from Modelica 3.7
- cover output-expression-list production
- expressions are now wrapped at every operator inside the precedence level where the original wrap occured as well as in all outer levels
- enum lists and argument lists are now wrapped if they contain descriptions without the need to run formatter twice
Bugfixes and performance improvements.
- Improve the performance up to 50%
- Remove the false syntax error caused by two comments separated with a blank line
- Fix the issue with increasing indentation in expressions that are wrapped multiple times
- Remove unnecessary whitespaces inserted before matrices in function arguments
- Correct indentation in if-expressions
- Add CLI options to print help message and
mofmt
version number
- Remove the parsing error when parsing function calls with mixed positional and named arguments
- Fix increased indentation and empty lines in wrapped matrices
- Fix additional spaces placed in lines before type specifiers that use global paths
- Fix line wrapping at inheritance modifiers (
break
statements insideextends
clauses) - Fix missing whitespaces before type specifiers that use global paths (starts with a dot)
- Fix errors caused by quoted identifiers containing spaces and double quotes
- Fix line wrapping inside external function calls and matrix rows
- Add info about formatted file path to error messages
- Prevent formatter from formatting files that contain syntax errors
- Fix increased indentation inside wrapped expressions
- Fix unwanted line breaks inside matrices
- Fix additional space inserted before the array argument that was broken by the user
- Fix issue with incorrect indentation when function call is broken inside wrapped expression
- Fix issue with additional blank lines when handling line comments between elements
This release introduces changes to mofmt formatting style that makes it more similar to Dymola's.
- Reduce indentation in class sections
- Add space between
annotation
keyword and class modification
- Remove string token splitting and indentation
- Fix issue with pre-commit hook running on multiple files
- Fix recursive directory walking
- Fix grammar in some error messages
Initial version.