Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyparsing to 3.1.4 #566

Closed
wants to merge 1 commit into from

Conversation

pyup-bot
Copy link
Collaborator

This PR updates pyparsing from 3.1.1 to 3.1.4.

Changelog

3.1.4

----------------------------
- Fix to type annotation that referenced `re.Pattern`. Since this type was introduced in
Python 3.7, using this type definition broke Python 3.6 installs of pyparsing. PR
submitted by Felix Fontein, nice work!

3.1.3

----------------------------
- Added new `Tag` ParserElement, for inserting metadata into the parsed results.
This allows a parser to add metadata or annotations to the parsed tokens.
The `Tag` element also accepts an optional `value` parameter, defaulting to `True`.
See the new `tag_metadata.py` example in the `examples` directory.

Example:

      add tag indicating mood
     end_punc = "." | ("!" + Tag("enthusiastic")))
     greeting = "Hello" + Word(alphas) + end_punc

     result = greeting.parse_string("Hello World.")
     print(result.dump())

     result = greeting.parse_string("Hello World!")
     print(result.dump())

prints:

     ['Hello', 'World', '.']

     ['Hello', 'World', '!']
     - enthusiastic: True

- Added example `mongodb_query_expression.py`, to convert human-readable infix query
expressions (such as `a==100 and b>=200`) and transform them into the equivalent
query argument for the pymongo package (`{'$and': [{'a': 100}, {'b': {'$gte': 200}}]}`).
Supports many equality and inequality operators - see the docstring for the
`transform_query` function for more examples.

- Fixed issue where PEP8 compatibility names for `ParserElement` static methods were
not themselves defined as `staticmethods`. When called using a `ParserElement` instance,
this resulted  in a `TypeError` exception. Reported by eylenburg (548).

- To address a compatibility issue in RDFLib, added a property setter for the
`ParserElement.name` property, to call `ParserElement.set_name`.

- Modified `ParserElement.set_name()` to accept a None value, to clear the defined
name and corresponding error message for a `ParserElement`.

- Updated railroad diagram generation for `ZeroOrMore` and `OneOrMore` expressions with
`stop_on` expressions, while investigating 558, reported by user Gu_f.

- Added `<META>` tag to HTML generated for railroad diagrams to force UTF-8 encoding
with older browsers, to better display Unicode parser characters.

- Fixed some cosmetics/bugs in railroad diagrams:
- fixed groups being shown even when `show_groups`=False
- show results names as quoted strings when `show_results_names`=True
- only use integer loop counter if repetition > 2

- Some type annotations added for parse action related methods, thanks August
Karlstedt (551).

- Added exception type to `trace_parse_action` exception output, while investigating
SO question posted by medihack.

- Added `set_name` calls to internal expressions generated in `infix_notation`, for
improved railroad diagramming.

- `delta_time`, `lua_parser`, `decaf_parser`, and `roman_numerals` examples cleaned up
to use latest PEP8 names and add minor enhancements.

- Fixed bug (and corresponding test code) in `delta_time` example that did not handle
weekday references in time expressions (like "Monday at 4pm") when the weekday was
the same as the current weekday.

- Minor performance speedup in `trim_arity`, to benefit any parsers using parse actions.

- Added early testing support for Python 3.13 with JIT enabled.

3.1.2

---------------------------
- Added `ieee_float` expression to `pyparsing.common`, which parses float values,
plus "NaN", "Inf", "Infinity". PR submitted by Bob Peterson (538).

- Updated pep8 synonym wrappers for better type checking compatibility. PR submitted
by Ricardo Coccioli (507).

- Fixed empty error message bug, PR submitted by InSync (534). This _should_ return
pyparsing's exception messages to a former, more helpful form. If you have code that
parses the exception messages returned by pyparsing, this may require some code
changes.

- Added unit tests to test for exception message contents, with enhancement to
`pyparsing.testing.assertRaisesParseException` to accept an expected exception message.

- Updated example `select_parser.py` to use PEP8 names and added Groups for better retrieval
of parsed values from multiple SELECT clauses.

- Added example `email_address_parser.py`, as suggested by John Byrd (539).

- Added example `directx_x_file_parser.py` to parse DirectX template definitions, and
generate a Pyparsing parser from a template to parse .x files.

- Some code refactoring to reduce code nesting, PRs submitted by InSync.

- All internal string expressions using '%' string interpolation and `str.format()`
converted to f-strings.
Links

@zStupan zStupan closed this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants