pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/py-pyparsing py-pyparsing: updated to 2.3.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/df156e0e84ea
branches:  trunk
changeset: 389999:df156e0e84ea
user:      adam <adam%pkgsrc.org@localhost>
date:      Tue Jan 15 11:37:21 2019 +0000

description:
py-pyparsing: updated to 2.3.1

Version 2.3.1
-------------
- POSSIBLE API CHANGE: this release fixes a bug when results names were
  attached to a MatchFirst or Or object containing an And object.
  Previously, a results name on an And object within an enclosing MatchFirst
  or Or could return just the first token in the And. Now, all the tokens
  matched by the And are correctly returned. This may result in subtle
  changes in the tokens returned if you have this condition in your pyparsing
  scripts.

- New staticmethod ParseException.explain() to help diagnose parse exceptions
  by showing the failing input line and the trace of ParserElements in
  the parser leading up to the exception. explain() returns a multiline
  string listing each element by name. (This is still an experimental
  method, and the method signature and format of the returned string may
  evolve over the next few releases.)

  Example:
        # define a parser to parse an integer followed by an
        # alphabetic word
        expr = pp.Word(pp.nums).setName("int")
               + pp.Word(pp.alphas).setName("word")
        try:
            # parse a string with a numeric second value instead of alpha
            expr.parseString("123 355")
        except pp.ParseException as pe:
            print_(pp.ParseException.explain(pe))

  Prints:
        123 355
            ^
        ParseException: Expected word (at char 4), (line:1, col:5)
        __main__.ExplainExceptionTest
        pyparsing.And - {int word}
        pyparsing.Word - word

  explain() will accept any exception type and will list the function
  names and parse expressions in the stack trace. This is especially
  useful when an exception is raised in a parse action.

  Note: explain() is only supported under Python 3.

- Fix bug in dictOf which could match an empty sequence, making it
  infinitely loop if wrapped in a OneOrMore.

- Added unicode sets to pyparsing_unicode for Latin-A and Latin-B ranges.

- Added ability to define custom unicode sets as combinations of other sets
  using multiple inheritance.

    class Turkish_set(pp.pyparsing_unicode.Latin1, pp.pyparsing_unicode.LatinA):
        pass

    turkish_word = pp.Word(Turkish_set.alphas)

- Updated state machine import examples, with state machine demos for:
  . traffic light
  . library book checkin/checkout
  . document review/approval

  In the traffic light example, you can use the custom 'statemachine' keyword
  to define the states for a traffic light, and have the state classes
  auto-generated for you:

      statemachine TrafficLightState:
          Red -> Green
          Green -> Yellow
          Yellow -> Red

  Similar for state machines with named transitions, like the library book
  state example:

      statemachine LibraryBookState:
          New -(shelve)-> Available
          Available -(reserve)-> OnHold
          OnHold -(release)-> Available
          Available -(checkout)-> CheckedOut
          CheckedOut -(checkin)-> Available

  Once the classes are defined, then additional Python code can reference those
  classes to add class attributes, instance methods, etc.

  See the examples in examples/statemachine

- Added an example parser for the decaf language. This language is used in
  CS compiler classes in many colleges and universities.

- Fixup of docstrings to Sphinx format, inclusion of test files in the source
  package, and convert markdown to rst throughout the distribution, great job
  by Mat?j Cepl!

- Expanded the whitespace characters recognized by the White class to include
  all unicode defined spaces.

- Added optional postParse argument to ParserElement.runTests() to add a
  custom callback to be called for test strings that parse successfully. Useful
  for running tests that do additional validation or processing on the parsed
  results. See updated chemicalFormulas.py example.

- Removed distutils fallback in setup.py. If installing the package fails,
  please update to the latest version of setuptools. Plus overall project code
  cleanup (CRLFs, whitespace, imports, etc.), thanks Jon Dufresne!

- Fix bug in CaselessKeyword, to make its behavior consistent with
  Keyword(caseless=True).

diffstat:

 devel/py-pyparsing/Makefile |   4 ++--
 devel/py-pyparsing/distinfo |  10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (27 lines):

diff -r ec9519c7b338 -r df156e0e84ea devel/py-pyparsing/Makefile
--- a/devel/py-pyparsing/Makefile       Tue Jan 15 11:30:29 2019 +0000
+++ b/devel/py-pyparsing/Makefile       Tue Jan 15 11:37:21 2019 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.13 2018/12/10 15:18:41 adam Exp $
+# $NetBSD: Makefile,v 1.14 2019/01/15 11:37:21 adam Exp $
 
-DISTNAME=      pyparsing-2.3.0
+DISTNAME=      pyparsing-2.3.1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=p/pyparsing/}
diff -r ec9519c7b338 -r df156e0e84ea devel/py-pyparsing/distinfo
--- a/devel/py-pyparsing/distinfo       Tue Jan 15 11:30:29 2019 +0000
+++ b/devel/py-pyparsing/distinfo       Tue Jan 15 11:37:21 2019 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.10 2018/12/10 15:18:41 adam Exp $
+$NetBSD: distinfo,v 1.11 2019/01/15 11:37:21 adam Exp $
 
-SHA1 (pyparsing-2.3.0.tar.gz) = 4c1668f50cf50feff838c1d2172ac034d42ff824
-RMD160 (pyparsing-2.3.0.tar.gz) = 0cad92687409a5ae8fc8bf80991029635645b3f6
-SHA512 (pyparsing-2.3.0.tar.gz) = f9038007b52ea880544349de7e767f92d1d31f0ced897241a487480f2723927c057bce7c967e4d9bdab1ac0cd4d9ae7e2a01e81bd357dc21b6271450aba8079c
-Size (pyparsing-2.3.0.tar.gz) = 857644 bytes
+SHA1 (pyparsing-2.3.1.tar.gz) = 616f04f73e8f168140df4d2c349dfae3259bf496
+RMD160 (pyparsing-2.3.1.tar.gz) = 90fca0886feae2fc8718fdd35a4390c55cc3cf5c
+SHA512 (pyparsing-2.3.1.tar.gz) = fc8342780c38fd08c07d0b885c4d6c77d59f38098aa13c3abd05a790ee6caf2065a0bdab33bc290a6e2da123f4ac7e38c049e389b740546499dc48eba7ae431f
+Size (pyparsing-2.3.1.tar.gz) = 596497 bytes



Home | Main Index | Thread Index | Old Index