Dhparser

Latest version: v1.8.3

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

Scan your dependencies

Page 4 of 8

19.10.2024

...................................

- optional speed optimizations (experimental!) that work by compiling
certain parts of the grammar to regular expressions. See config value
"optimizations" or put "optimizations=all" at the top of your grammar.
- serializations for xast and unist ("ndst") added.
See https://github.com/syntax-tree/unist
and https://github.com/syntax-tree/xast
- fast-path for Series-parser, in case no items are marked as mandatory
- faster unit-tests: History recording will only be invoked if a
test fails in which case the test will be repeated with history
recording. (If a tested parser contains lookahead statements,
history-recording is always invoked, because it is needed to
detect false negatives.)
- unit-test-scripts (i.e. "tst_..._grammary.py") can now be invoked
with the "--history" (or "-p") option to record detailed logs for all
tests, not only those tests that have failed. (So, it is easier to
study what a particular parser actually does.)
- functions added: nodetree.drop_leaf() and transform.pull_up()
- changes: parse.py: removed memoization equivalence classes to
simplify code (speed up was very neglible, anyway)
parse.py: Regular expressions of RegExp-parsers are now evaluated
lazily to keep startup times in check
- nim-rewrite of parser core under way, e.g. run-ranges added as
first step to get rid of regular epressions.
- lsp-module removed from documentation to avoid index-clutter

19.7.2023

..................................

- parse.py: The (insignificant) "Whitespace"-parser is now optional
per default. This simplifies writing regular expressions for
insignificant whitespace, but can lead to BREAKING badly formulated
grammars, because optional-testing during static analysis is now
more comprehensive.
- ebnf.py: bugfix for linefeed whitespace-parser and added line-start
whitespace-parser.
- parse.py: removed methods for combining parsers, i.e. turn cascades
of nested Series, Interleave or Alternative parsers into one
flat parser with a longer list of arguments, because these are
practically never needed and have undesired side effects.
- parse.py: Speed-Optimization by implementing simplified __call__-methods
for leaf-parsers and for parsers that do not memoize.
- parse.py: class LateBindingUnary added (experimental!)
- testing.py: allow to set config-values in test-files.
- EXPERIMENTAL: started a nim-rewrite of the parser core to increase
parser speed to the level of a compiled language, i.e. nim (nim-lang.org)

19.4.2023

..................................

- NEW: Macros for EBNF grammars added!
- better support for (post-)processing pipelines (dsl.py and compile.py)
- added an (autogenerated) ...App.py script that allows to select files
for compilation with a simple GUI. (This helps to deploy projects
for users that are not used to the command line.)
Like the ...Parser.py and ...Server.py-scripts, this script is
generated when running the grammar-tests-script for the first time in
a new project.
- refactoring of the template for autogenerated ...Parser.py-scripts
to make them shorter and more readable.
- autogenerated tst_..._grammar.py-script will generate ...Server.py
and ...App.py script only once and not regenerate them automatically
if they have been deleted. Pass "--scripts" on the command line to
re-create these scripts if needed.
- nodetree.py: support for SXML-serialization
(see https://okmij.org/ftp/Scheme/SXML.html)

18.5.2022

..................................

- faster parser: now uses text locations instead of string views to hand over
the rest of the document to the next parser. Approx 25% faster!
- Cython compatibility restored

17.11.2022

...................................

- New Requirement: Python 3.7 or greater!!!
(due to from __future__ import annoataions)
- EBNF-grammars can now refer to custom Python parsers
- EBNF-grammars can now attach errors to the syntax-tree directly,
e.g. number = digits | Error("Not A Number") /.*?\d/
- cython support moved to cython3, cython3 compatibility restored
- support for arbitrary data, i.e. not only tree-data in intermediary
steps of DHParser.compile-module's processing pipelines via optional
RootNode.data - attribute
- order of detailed manuals in documentation re-arranged

11.5.2020

..................................

- Moved to poetry-packaging <https://github.com/python-poetry/poetry>

Page 4 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.