Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork298
Pyparsing 3.2.2
The upcoming version 3.3.0 release will begin emittingDeprecationWarnings for pyparsing methods that have been renamed to PEP8-compliant names (introduced in pyparsing 3.0.0, in August, 2021, with legacy names retained as aliases). In preparation, I have added in pyparsing 3.2.2 a utility for finding and replacing the legacy method names with the new names. This utility is located atpyparsing/tools/cvt_pep8_names.py. This script will scan all Python files specified on the command line, and if the-u option is selected, will replace all occurrences of the old method names with the new PEP8-compliant names, updating the files in place.
Here is an example that converts all the files in the pyparsing/examples directory:
python -m pyparsing.tools.cvt_pyparsing_pep8_names -u examples/*.pyThe new names are compatible with pyparsing versions 3.0.0 and later.
Released
cvt_pyparsing_pep8_names.pyconversion utility to upgrade pyparsing-based programs and libraries that use legacy camelCase names to use the new PEP8-compliant snake_case method names. The converter can also be imported into other scripts asfrom pyparsing.tools.cvt_pyparsing_pep8_names import pep8_converterFixed bug in
nested_exprwhere nested contents were stripped of whitespace when the default whitespace characters were cleared (raised in this StackOverflow questionhttps://stackoverflow.com/questions/79327649 by Ben Alan). Also addressed bug in resolving PEP8 compliant argument name and legacy argument name.Fixed bug in
rest_of_lineand the underlyingRegexclass, in which matching a pattern that could match an empty string (such as".*"or"[A-Z]*"would not raise aParseExceptionat or beyond the end of the input string. This could cause an infinite parsing loop when parsingrest_of_lineat the end of the input string. Reported by user Kylotan, thanks! (Issue#593)Enhancements and extra input validation for
pyparsing.util.make_compressed_re- see usage inexamples/complex_chemical_formulas.pyand result in the generated railroad diagramexamples/complex_chemical_formulas_diagram.html. Properly escapes characters like "." and "*" that have special meaning in regular expressions.Fixed bug in
one_of()to properly escape characters that are regular expression markers (such as '*', '+', '?', etc.) before building the internal regex.Better exception message for
MatchFirstandOrexpressions, showing all alternatives rather than just the first one. Fixes Issue#592, reported by Focke, thanks!Added return type annotation of "-> None" for all
__init__()methods, to satisfymypy --stricttype checking. PR submitted by FeRD, thank you!Added optional argument
show_hiddentocreate_diagramto show elements that are used internally by pyparsing, but are not part of the actual parser grammar. For instance, theTagclass can insert values into the parsed results but it does not actually parse any input, so by default it is not included in a railroad diagram. By callingcreate_diagramwithshow_hidden=True, these internal elements will be included. (You can see this in the tag_metadata.py script in the examples directory.)Fixed bug in
number_words.pyexample. Also addedebnf_number_words.pyto demonstrate using theebnf.pyEBNF parser generator to build a similar parser directly from EBNF.Fixed syntax warning raised in
bigquery_view_parser.py, invalid escape sequence "\s". Reported by sameer-google, nice catch! (Issue#598)Added support for Python 3.14.
Assets4
Uh oh!
There was an error while loading.Please reload this page.