竜 TatSu uses Semantic Versioning for its releases, so parts of the version number may increase without any significant changes or backwards incompatibilities in the software.
The format of this Change Log is inspired by keeapachangelog.org.
X.Y.Z @ 2022
5.8.0 @ 2022-03-12
- Make sure that the generated parser is the same as the bootstrap parser.
- Honor grouping in pattern expressions with the semantics of
re.findall(pattern, text)[0]
. Now groups that should not be returned when parsing should use the(?:)
syntax. - Now patterns align with Python
re
independently of the@@ignorecase
setting for the grammar. - Allow
{}
interpolation in`constant`
expressions with the semantics ofstr.format()
- Add
```constant```
as a multiline version of`constant`
. - Add ^`````constant````` and ^```constant``` as syntax for an alert expression. Alerts produce no tokens bug get registed in parseinfo records.
- BUG: make the
->
skip expression always stop at EOF. - Make the
->
skip expression go over comments, and not log while skipping. - Patch problem with pickling
FailedCut
while running parsing in parallel. - Optimize model pickling and parallel processing to reduce runtime and memory use with
parproc
- Add a representation of
~
cut expressions to parse traces
5.7.3 @ 2021-12-20
- Fix that settings passed to
Context.parse()
were ignored. AddContext.active_config
for the configuration active during a parse - Define
Node._parent
as part of the@dataclass
5.7.2 @ 2021-12-18
- Make
AST
andNode
hashable. Necessary for cachingNode.children()
- Implement
Node.__eq__()
in terms of identity orNode.ast.__eq__()__
- Fix regression in which rule order is lost in generated parsers (@dtrckd)
- Restore
Node.ast
(was removed because of problems with__eq__()
) - Get
Node.children()
fromNode.ast
when there are no attributes defined for theNode
. This restores the desired behavior while developing a parse model.
5.7.1 @ 2021-12-03
- Simplified this CHANGELOG by not linking to issues or and pull requests that can be queried on Github
- Now
config: ParserConfig
is used in__init__()
andparse()
methods ofcontexts.ParseContext
,grammars.Grammar
, and elsewhere to avoid long parameter lists.ParserConfig
also provides clean and clear ways of overridinga group of settings - All names defined in the successful choice in a rule are now defined in the resulting AST. Names within optionals that did not match will have their values set to
None
, and closures that did not match will be set to[]
- Moved build configuration from
setup.py
in favor ofsetup.cfg
andpyproject.toml
(@KOLANICH) Node.children()
is now computed only when required, and cached- Classes in generated object models are now
@dataclass
- Optimize and get rid of bugs and annoyances while keeping backwards compatibility
- Drop support for Python < 3.10
5.6.1 @ 2021-03-22
- Fix bug in which rule fields were forced on empty
AST
(@Victorious3)
5.6.0 @ 2021-03-21
- Several important refactorings in
contexts.ParseContext
- Make
ignorecase
settings apply to defined@@keywords
- Move checking of keywords used as names into
ParseContext
- Output of generated parsers again matches that of model parsers
- Improve "expecting one of:" messages so elements are in declaration order
- Stop code generation if there are closures over possibly empty expressions
- Preserve name declaration order in returned
AST
- Update the bootstrap parser (
tatsu/bootstrap.py
) to the generated parser - Now generated parser's
main()
only outputs the JSON for the parseAST
- Minor version bumped in case the many fixes break backwards-compatibility
- Minor documentation issues fixed
- All tests run with Python 3.8, 3.9, 3.10
5.5.0 @ 2020-01-26
- #156 Clarify limitations of left-recursion in PEG (@apalala)
- #159 Clean up examples and tutorial, upgrade them to Python 3 (@okomarov)
5.0.0 @ 2020-01-26
- 竜 TatSu is now only tested against Python 3.8. Earlier versions of Python are now deprecated, and Python 2.X versions are no longer supported.
- Apply
nameguard
only iftoken[0].isalpha()
. This solves a regression afecting previous TatSu and Grako grammars (@apalala). - Remove
pygraphviz
from develoment requirements, as it doesn't build under Py38 - #56 Include missing
tatsu/g2e/antlr.ebnf
in distribution - #138 Reimplement the calculation of
FIRST
,FOLLOW
, andLOOKAHEAD
sets using latest theories. For now, this should improve parser error reporting, but should eventually enable the simplification of parsing of leftrec grammars (@apalala). - #153 Import ABCs from
collections.abc
(@tirkarthi) - The AST for sequences is now a
tuple
(it used to be alist
-derivedclosure
)
4.4.0 @ 2019-04-22
- The default regexp for whitespace was changed to
(?s)\s+
- Allow empty patterns (
//
) like Python does - #65 Allow initial, consecutive, and trailing
@namechars
- #73 Allow
@@whitespace :: None
and@@whitespace :: False
- #75 Complete implemenation of left recursion (@Victorious3)
- #77 Allow
@keyword
throughout the grammar - #89 Make all attributes defined in the rule present in the resulting
AST
orNode
even if the associated expression was not parsed - #93 Fix trace colorization on Windows
- #96 Documented each
@@directive
- Switched the documentation to the "Alabaster" theme
- Various code and documentation fixes (@davesque, @nicholasbishop, @rayjolt)
4.3.0 @ 2018-11-17
- #66 Fix multiline (
(?x)
) patterns not properly supported in grammar (@pdw-mb) - #70 Important upgrade to
ModelBuilder
and grammar specification of classes for generated nodes. See pull request #78 for details (@Victorious3)
4.2.6 @ 2018-05-06
- #56 Add missing
tatsu/g2e/antlr.ebnf
to distribution (@Ruth-Polymnia) - #62 Fix 竜 TatSu ignoring start rule provided in command line (@r-chaves)
- Fix typos in documentation (@mjdominus)
4.2.5 @ 2017-11-26
- #42 Rename vim files from
grako.vim
totatsu.vim
(@fcoelho) - #51 Fix inconsistent code generation for
whitespace
(@fpom) - #54 Only care about case of first letter of rule name for determining advance over whitespace (@acw1251)
4.2.4 @ 2017-07-10
- #40 Make the start rule default to the first rule defined in the grammar (@hariedo)
- #43 Import 're' from tatsu.util to support optional 'regex'-only features (@azazel75)
- #47 Fix incorrect sample code in documentation (@apalala)
4.2.3 @ 2017-07-10
- #37 Regression: The
#include
pragma works by using theEBNFBuffer
fromgrammars.py
. Somehow the defaultEBNFBootstrapBuffer
frombootstrap.py
has been used instead (@gegenschall). - #38 Documentation: Use of
json.dumps()
requiresast.asjson()
(@davidchen).
4.2.2 @ 2017-07-01
- #27 Undo the fixes to dropped input on left recursion because they broke previous expected behavior.
- #33 Fixes to the calc example and mini tutorial (@heronils)
- #34 More left-recursion test cases (@manueljacob).
4.2.1 @ 2017-06-18
- #27 Left-recursive parsers would drop or skip input on many combinations of grammars and correct/incorrect inputs(@manueljacob)
- Documentation fixes (@manueljacob, @paulhoule)
4.2.0 @ 2017-05-21
- Parse speeds on large files reduced by 5-20% by optimizing parse contexts and closures, and unifying the AST and CST stacks.
- Added the "skip to" expression (
->
), useful for writing recovery rules. The parser will advance over input, one character at time, until the expression matches. Whitespace and comments will be skipped at each step. - Added the any expression (
/./
) for matching the next character in the input. - The ANTLR grammar for Python3 to the
g2e
example, and udateg2e
to handle more ANTLR syntax. - Check typing with Mypy.
- Removed the very old _regex_ example.
- Make parse traces more compact. Add a sample to the docs.
- Explain Grako compatibility in docs.
4.1.1 @ 2017-05-21
tatus.objectmodel.Node
not setting attributes fromAST
.
4.1.0 @ 2017-05-21
- New support for left recursion with correct associativity. All test cases pass.
- Left recursion is enabled by default. Use the
@@left_recursion :: False
directive to diasable it. - Renamed the decorator for generated rule methods to
@tatsumasu
. - Refactored the
tatsu.contexts.ParseContext
for clarity. - The
@@ignorecase
directive and theignorecase=
parameter no longer appy to regular expressions (patterns) in grammars. Use(?i)
in the pattern to ignore the case in a particular pattern. - Now
tatsu.g2e
is a library and executable module for translating ANTLR grammars to TatSu. - Modernized the
calc
example and made it part of the documentation as Mini Tutorial. - Simplified the generated object models using the semantics of class attributes in Python
4.0.0 @ 2017-05-06
- First release.