pyparsing 3.2.2__tar.gz → 3.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyparsing-3.2.2 → pyparsing-3.2.3}/CHANGES +9 -1
- {pyparsing-3.2.2 → pyparsing-3.2.3}/PKG-INFO +1 -1
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/__init__.py +2 -2
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/helpers.py +19 -8
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_unit.py +22 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/.coveragerc +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/.gitignore +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/.pre-commit-config.yaml +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/BUILDING.md +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/CODE_OF_CONDUCT.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/CONTRIBUTING.md +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/LICENSE +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/README.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/CODE_OF_CONDUCT.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/HowToUsePyparsing.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/Makefile +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/_static/pyparsingClassDiagram_1.5.2.jpg +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/_static/pyparsingClassDiagram_3.0.9.jpg +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/_static/sql_railroad.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/conf.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/index.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/make_sphinx_docs.bat +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/modules.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/pyparsing.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/pyparsing_class_diagram.puml +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/whats_new_in_3_0_0.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/whats_new_in_3_1.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/whats_new_in_3_2.rst +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/docs/whats_new_in_x_x_template.rst.txt +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/AcManForm.dfm +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/LAparser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/README.md +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/Setup.ini +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/SimpleCalc.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/SingleForm.dfm +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/TAP.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/TAP_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/__init__.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/adventureEngine.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/adventure_game_parser_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/antlr_grammar.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/antlr_grammar_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/antlr_grammar_tests.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/apicheck.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/apicheck_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/bf.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/bf_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/bigquery_view_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/booleansearchparser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/btpyparse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/builtin_parse_action_demo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/cLibHeader.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/chemical_formulas.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/chemical_formulas.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/commasep.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/complex_chemical_formulas.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/complex_chemical_formulas_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/configParse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/cpp_enum_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/cuneiform_python.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/datetime_parse_actions.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/decaf_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/decaf_parser_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/delta_time.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/delta_time_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/dfmparse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/dhcpd_leases_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/dictExample.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/dictExample2.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/directx_x_file_parser.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/directx_x_file_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/ebnf.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/ebnf_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/ebnf_number_parser_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/ebnf_number_words.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/ebnftest.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/email_address_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/eval_arith.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/excel_expr.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/fourFn.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/gen_ctypes.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/getNTPserversNew.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/greeting.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/greetingInGreek.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/greetingInKorean.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/groupUsingListAllMatches.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/hola_mundo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/html_stripper.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/html_table_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/httpServerLogParser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/idlParse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/include_preprocessor.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/indentedGrammarExample.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/indented_block_example.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/infix_math_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/inv_regex.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/javascript_grammar.g +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/jsonParser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/left_recursion.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lineno_example.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/listAllMatches.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lox_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lox_parser_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lua_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lua_parser_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lucene_grammar.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/lucene_grammar_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/macro_expander.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/make_diagram.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/matchPreviousDemo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/mongodb_query_expression.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/mongodb_query_expression.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/mongodb_query_expression_step_0.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/mozilla.ics +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/mozillaCalendarParser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/nested.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/nested_markup.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/number_words.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/number_words_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/numerics.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/oc.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/one_to_ninety_nine.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/parseTabularData.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/parse_python_value.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/parse_python_value.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/parse_results_sum_example.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/partial_gene_match.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/pgn.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/position.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/protobuf_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/pythonGrammarParser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/railroad_diagram_demo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/range_check.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/readJson.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/removeLineBreaks.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/roman_numerals.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/roman_numerals_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/rosettacode.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/rosettacode_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/scanExamples.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/searchParserAppDemo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/searchparser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/select_parser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/sexpParser.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/shapes.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/simpleArith.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/simpleBool.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/simpleSQL.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/simpleWiki.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/snmp_api.h +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/sql2dot.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/stackish.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/documentSignoffDemo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/documentsignoffstate.pystate +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/libraryBookDemo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/librarybookstate.pystate +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/statemachine.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/trafficLightDemo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/trafficlightstate.pystate +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/vending_machine.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/video_demo.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/statemachine/videostate.pystate +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/tag_emitter.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/tag_metadata.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/tag_metadata_diagram.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/test_bibparse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/unicode_denormalizer.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/urlExtractor.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/urlExtractorNew.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/verilog_parse.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/withAttribute.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/examples/wordsToNum.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/actions.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/common.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/core.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/diagram/__init__.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/exceptions.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/py.typed +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/results.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/testing.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/tools/__init__.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/tools/cvt_pyparsing_pep8_names.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/unicode.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyparsing/util.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/pyproject.toml +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/readthedocs.yaml +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/README.md +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/__init__.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/diag_embed.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/diag_no_embed.html +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/json_parser_tests.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/karthik.ini +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/mypy-ignore-cases/forward_methods.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/parsefiletest_input_file.txt +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/requirements.txt +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_diagram.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_examples.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_matplotlib_cases.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_pep8_converter.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_simple_unit.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tests/test_util.py +0 -0
- {pyparsing-3.2.2 → pyparsing-3.2.3}/tox.ini +0 -0
|
@@ -35,7 +35,7 @@ Required Python versions by pyparsing version
|
|
|
35
35
|
+--------------------------------------------------+-------------------+
|
|
36
36
|
| pyparsing version | Required Python |
|
|
37
37
|
+==================================================+===================+
|
|
38
|
-
| 3.2.0 -
|
|
38
|
+
| 3.2.0 - later | 3.9 or later |
|
|
39
39
|
| 3.0.8 - 3.1.4 | 3.6.8 or later |
|
|
40
40
|
| 3.0.0 - 3.0.7 (these versions are discouraged) | 3.6 or later |
|
|
41
41
|
| 2.4.7 | 2.7 or later |
|
|
@@ -43,6 +43,14 @@ Required Python versions by pyparsing version
|
|
|
43
43
|
+--------------------------------------------------+-------------------+
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
Version 3.2.3 - March, 2025
|
|
47
|
+
---------------------------
|
|
48
|
+
- Fixed bug released in 3.2.2 in which `nested_expr` could overwrite parse actions
|
|
49
|
+
for defined content, and could truncate list of items within a nested list.
|
|
50
|
+
Fixes Issue #600, reported by hoxbro and luisglft, with helpful diag logs and
|
|
51
|
+
repro code.
|
|
52
|
+
|
|
53
|
+
|
|
46
54
|
Version 3.2.2 - March, 2025
|
|
47
55
|
---------------------------
|
|
48
56
|
- Released `cvt_pyparsing_pep8_names.py` conversion utility to upgrade pyparsing-based
|
|
@@ -120,8 +120,8 @@ class version_info(NamedTuple):
|
|
|
120
120
|
return f"{__name__}.{type(self).__name__}({', '.join('{}={!r}'.format(*nv) for nv in zip(self._fields, self))})"
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
__version_info__ = version_info(3, 2,
|
|
124
|
-
__version_time__ = "
|
|
123
|
+
__version_info__ = version_info(3, 2, 3, "final", 1)
|
|
124
|
+
__version_time__ = "25 Mar 2025 01:38 UTC"
|
|
125
125
|
__version__ = __version_info__.__version__
|
|
126
126
|
__versionTime__ = __version_time__
|
|
127
127
|
__author__ = "Paul McGuire <ptmcg.gm+pyparsing@gmail.com>"
|
|
@@ -418,6 +418,8 @@ def locatedExpr(expr: ParserElement) -> ParserElement:
|
|
|
418
418
|
)
|
|
419
419
|
|
|
420
420
|
|
|
421
|
+
# define special default value to permit None as a significant value for
|
|
422
|
+
# ignore_expr
|
|
421
423
|
_NO_IGNORE_EXPR_GIVEN = NoMatch()
|
|
422
424
|
|
|
423
425
|
|
|
@@ -498,11 +500,13 @@ def nested_expr(
|
|
|
498
500
|
"""
|
|
499
501
|
if ignoreExpr != ignore_expr:
|
|
500
502
|
ignoreExpr = ignore_expr if ignoreExpr is _NO_IGNORE_EXPR_GIVEN else ignoreExpr
|
|
503
|
+
|
|
501
504
|
if ignoreExpr is _NO_IGNORE_EXPR_GIVEN:
|
|
502
505
|
ignoreExpr = quoted_string()
|
|
503
506
|
|
|
504
507
|
if opener == closer:
|
|
505
508
|
raise ValueError("opening and closing strings cannot be the same")
|
|
509
|
+
|
|
506
510
|
if content is None:
|
|
507
511
|
if isinstance(opener, str_type) and isinstance(closer, str_type):
|
|
508
512
|
opener = typing.cast(str, opener)
|
|
@@ -519,8 +523,11 @@ def nested_expr(
|
|
|
519
523
|
)
|
|
520
524
|
)
|
|
521
525
|
else:
|
|
522
|
-
content =
|
|
523
|
-
|
|
526
|
+
content = Combine(
|
|
527
|
+
Empty()
|
|
528
|
+
+ CharsNotIn(
|
|
529
|
+
opener + closer + ParserElement.DEFAULT_WHITE_CHARS
|
|
530
|
+
)
|
|
524
531
|
)
|
|
525
532
|
else:
|
|
526
533
|
if ignoreExpr is not None:
|
|
@@ -544,10 +551,12 @@ def nested_expr(
|
|
|
544
551
|
raise ValueError(
|
|
545
552
|
"opening and closing arguments must be strings if no content expression is given"
|
|
546
553
|
)
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
554
|
+
|
|
555
|
+
# for these internally-created context expressions, simulate whitespace-skipping
|
|
556
|
+
if ParserElement.DEFAULT_WHITE_CHARS:
|
|
557
|
+
content.set_parse_action(
|
|
558
|
+
lambda t: t[0].strip(ParserElement.DEFAULT_WHITE_CHARS)
|
|
559
|
+
)
|
|
551
560
|
|
|
552
561
|
ret = Forward()
|
|
553
562
|
if ignoreExpr is not None:
|
|
@@ -556,7 +565,9 @@ def nested_expr(
|
|
|
556
565
|
)
|
|
557
566
|
else:
|
|
558
567
|
ret <<= Group(Suppress(opener) + ZeroOrMore(ret | content) + Suppress(closer))
|
|
568
|
+
|
|
559
569
|
ret.set_name(f"nested {opener}{closer} expression")
|
|
570
|
+
|
|
560
571
|
# don't override error message from content expressions
|
|
561
572
|
ret.errmsg = None
|
|
562
573
|
return ret
|
|
@@ -621,7 +632,7 @@ def _makeTags(tagStr, xml, suppress_LT=Suppress("<"), suppress_GT=Suppress(">"))
|
|
|
621
632
|
|
|
622
633
|
|
|
623
634
|
def make_html_tags(
|
|
624
|
-
tag_str: Union[str, ParserElement]
|
|
635
|
+
tag_str: Union[str, ParserElement],
|
|
625
636
|
) -> tuple[ParserElement, ParserElement]:
|
|
626
637
|
"""Helper to construct opening and closing tag expressions for HTML,
|
|
627
638
|
given a tag name. Matches tags in either upper or lower case,
|
|
@@ -648,7 +659,7 @@ def make_html_tags(
|
|
|
648
659
|
|
|
649
660
|
|
|
650
661
|
def make_xml_tags(
|
|
651
|
-
tag_str: Union[str, ParserElement]
|
|
662
|
+
tag_str: Union[str, ParserElement],
|
|
652
663
|
) -> tuple[ParserElement, ParserElement]:
|
|
653
664
|
"""Helper to construct opening and closing tag expressions for XML,
|
|
654
665
|
given a tag name. Matches tags only in the given upper/lower case.
|
|
@@ -5463,6 +5463,28 @@ class Test02_WithoutPackrat(ppt.TestParseResultsAsserts, TestCase):
|
|
|
5463
5463
|
# make sure things have been put back properly
|
|
5464
5464
|
self.assertEqual(pp.ParserElement.DEFAULT_WHITE_CHARS, prior_ws_chars)
|
|
5465
5465
|
|
|
5466
|
+
def testNestedExpressions4(self):
|
|
5467
|
+
allowed = pp.alphas
|
|
5468
|
+
plot_options_short = pp.nestedExpr('[',
|
|
5469
|
+
']',
|
|
5470
|
+
content=pp.OneOrMore(pp.Word(allowed) ^ pp.quotedString)
|
|
5471
|
+
).setResultsName('plot_options')
|
|
5472
|
+
|
|
5473
|
+
self.assertParseAndCheckList(
|
|
5474
|
+
plot_options_short,
|
|
5475
|
+
"[slkjdfl sldjf [lsdf'lsdf']]",
|
|
5476
|
+
[['slkjdfl', 'sldjf', ['lsdf', "'lsdf'"]]]
|
|
5477
|
+
)
|
|
5478
|
+
|
|
5479
|
+
def testNestedExpressionDoesNotOverwriteParseActions(self):
|
|
5480
|
+
content = pp.Word(pp.nums + " ")
|
|
5481
|
+
|
|
5482
|
+
content.add_parse_action(lambda t: None)
|
|
5483
|
+
orig_pa = content.parseAction[0]
|
|
5484
|
+
|
|
5485
|
+
expr = pp.nested_expr(content=content)
|
|
5486
|
+
assert content.parseAction[0] is orig_pa
|
|
5487
|
+
|
|
5466
5488
|
def testWordMinMaxArgs(self):
|
|
5467
5489
|
parsers = [
|
|
5468
5490
|
"A" + pp.Word(pp.nums),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|