Skip to content

Pyparsing 3.1.0b1

Pre-release
Pre-release
Compare
Choose a tag to compare
@ptmcg ptmcg released this 08 Apr 19:07
· 105 commits to master since this release
  • Added support for Python 3.12.

  • API CHANGE: A slight change has been implemented when unquoting a quoted string parsed using the QuotedString class. Formerly, when unquoting and processing whitespace markers such as \t and \n, these substitutions would occur first, and then any additional '' escaping would be done on the resulting string. This would parse "\n" as "<newline>". Now escapes and whitespace markers are all processed in a single pass working left to right, so the quoted string "\n" would get unquoted to "\n" (a backslash followed by "n"). Fixes issue #474 raised by jakeanq, thanks!

  • Added named field "url" to pyparsing.common.url, returning the entire parsed URL string.

  • Fixed bug when parse actions returned an empty string for an expression that had a results name, that the results name was not saved. That is:

    expr = Literal("X").add_parse_action(lambda tokens: "")("value")
    result = expr.parse_string("X")
    print(result["value"])
    

    would raise a KeyError. Now empty strings will be saved with the associated results name. Raised in Issue #470 by Nicco Kunzmann, thank you.

  • Fixed bug in SkipTo where ignore expressions were not properly handled while scanning for the target expression. Issue #475, reported by elkniwt, thanks (this bug has been there for a looooong time!).

  • Updated ci.yml permissions to limit default access to source - submitted by Joyce Brum of Google. Thanks so much!

  • Updated the lucene_grammar.py example (better support for '*' and '?' wildcards) and corrected the test cases - brought to my attention by Elijah Nicol, good catch!