Skip to content

Conversation

@dependabot-preview
Copy link
Contributor

Bumps pyparsing from 2.3.0 to 2.4.1.

Release notes

Sourced from pyparsing's releases.

Pyparsing 2.4.1

For a minor point release, this release contains many new features!

  • A new shorthand notation has been added for repetition expressions: expr[min, max], with ... valid as a min or max value:

    • expr[...] is equivalent to OneOrMore(expr)
    • expr[0, ...] is equivalent to ZeroOrMore(expr)
    • expr[1, ...] is equivalent to OneOrMore(expr)
    • expr[n, ...] or expr[n,] is equivalent to expr*n + ZeroOrMore(expr) (read as "n or more instances of expr")
    • expr[..., n] is equivalent to expr*(0, n)
    • expr[m, n] is equivalent to expr*(m, n)
      Note that expr[..., n] and expr[m, n] do not raise an exception if more than n exprs exist in the input stream. If this behavior is desired, then write expr[..., n] + ~expr.
  • ... can also be used as short hand for SkipTo when used in adding parse expressions to compose an And expression.

    Literal('start') + ... + Literal('end')
    And(['start', ..., 'end'])
    

    are both equivalent to:

    Literal('start') + SkipTo('end')("_skipped*") + Literal('end')
    

    The ... form has the added benefit of not requiring repeating the skip target expression. Note that the skipped text is returned with '_skipped' as a results name, and that the contents of _skipped will contain a list of text from all ...s in the expression.

  • ... can also be used as a "skip forward in case of error" expression:

      expr = "start" + (Word(nums).setName("int") | ...) + "end"
    
      expr.parseString("start 456 end")
      ['start', '456', 'end']
    
      expr.parseString("start 456 foo 789 end")
      ['start', '456', 'foo 789 ', 'end']
      - _skipped: ['foo 789 ']
    
      expr.parseString("start foo end")
      ['start', 'foo ', 'end']
      - _skipped: ['foo ']
    
      expr.parseString("start end")
      ['start', '', 'end']
      - _skipped: ['missing <int>']
    

    Note that in all the error cases, the '_skipped' results name is present, showing a list of the extra or missing items.

    This form is only valid when used with the '|' operator.

  • Improved exception messages to show what was actually found, not just what was expected.

      word = pp.Word(pp.alphas)
      pp.OneOrMore(word).parseString("aaa bbb 123", parseAll=True)
    
... (truncated)
Changelog

Sourced from pyparsing's changelog.

Version 2.4.1 - July, 2019

  • NOTE: Deprecated functions and features that will be dropped
    in pyparsing 2.5.0 (planned next release):

    . support for Python 2 - ongoing users running with
    Python 2 can continue to use pyparsing 2.4.1

    . ParseResults.asXML() - if used for debugging, switch
    to using ParseResults.dump(); if used for data transfer,
    use ParseResults.asDict() to convert to a nested Python
    dict, which can then be converted to XML or JSON or
    other transfer format

    . operatorPrecedence synonym for infixNotation -
    convert to calling infixNotation

    . commaSeparatedList - convert to using
    pyparsing_common.comma_separated_list

    . upcaseTokens and downcaseTokens - convert to using
    pyparsing_common.upcaseTokens and downcaseTokens

    . compat.collect_all_And_tokens will not be settable to
    False to revert to pre-2.3.1 results name behavior -
    review use of names for MatchFirst and Or expressions
    containing And expressions, as they will return the
    complete list of parsed tokens, not just the first one.
    Use diag.warn_multiple_tokens_in_named_alternation
    (described below) to help identify those expressions
    in your parsers that will have changed as a result.

  • A new shorthand notation has been added for repetition
    expressions: expr[min, max], with '...' valid as a min
    or max value:

    • expr[...] is equivalent to OneOrMore(expr)
    • expr[0, ...] is equivalent to ZeroOrMore(expr)
    • expr[1, ...] is equivalent to OneOrMore(expr)
    • expr[n, ...] or expr[n,] is equivalent
      to expr*n + ZeroOrMore(expr)
      (read as "n or more instances of expr")
    • expr[..., n] is equivalent to expr*(0, n)
    • expr[m, n] is equivalent to expr*(m, n)
      Note that expr[..., n] and expr[m, n] do not raise an exception
      if more than n exprs exist in the input stream. If this
      behavior is desired, then write expr[..., n] + ~expr.
  • '...' can also be used as short hand for SkipTo when used
    in adding parse expressions to compose an And expression.

... (truncated)
Commits
  • 07d82bb Fix latent bug if adding a parse action after having cleared parse actions wi...
  • a6203b1 Update coding styles; better comments, attribution of example file
  • 33ca34c Change example to use addCondition instead of parse action that raises ParseE...
  • de00f57 Missing bits in CONTRIBUTING file
  • 6ea260a Add CONTRIBUTING.md guidelines; code and whitespace cleanup
  • 5a566b5 Update/cleanup code in examples
  • 7d96e56 Update __eq__ to Py2/Py3 compat
  • b295bc1 Some code cleanup based on inspection reports
  • 4e54534 Some performance refinements, pre-resolving re.match to re_match attribute, o...
  • ddaf822 Simplify from_dict signature, support nested dict -> nested ParseResults
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it). To ignore the version in this PR you can just close it
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/pyparsing/pyparsing/releases)
- [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES)
- [Commits](pyparsing/pyparsing@pyparsing_2.3.0...pyparsing_2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Jul 22, 2019
@dependabot-preview
Copy link
Contributor Author

Superseded by #156.

@dependabot-preview dependabot-preview bot deleted the dependabot/pip/pyparsing-2.4.1 branch July 29, 2019 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant