ANN: pyparsing-1.3 released

Discussion in 'Python' started by Paul McGuire, Mar 26, 2005.

  1. Paul McGuire

    Paul McGuire Guest

    I'm happy to announce that 1) pyparsing has been pretty stable for the
    past 6 months (the last formal release 1.2.2 was last September), and
    2) I finally found the time to put together a new release, version 1.3.
    This release also includes all of the enhancements I posted to CVS
    last fall as version 1.2.3, but never formally released.

    Here are some of the major new features and bug-fixes:

    Version 1.3 - March, 2005
    ----------------------------------
    - Added new Keyword class, as a special form of Literal. Keywords must
    be followed by whitespace or other non-keyword characters, to
    distinguish them from variables or other identifiers that just happen
    to start with the same characters as a keyword. For instance, the
    input string containing "ifOnlyIfOnly" will match a Literal("if") at
    the beginning and in the middle, but will fail to match a
    Keyword("if"). Keyword("if") will match only strings such as "if only"
    or "if(only)". (Berteun Damman requested this on comp.lang.python -
    great idea!)

    - Added setWhitespaceChars() method to override the characters to be
    skipped as whitespace before matching a particular ParseElement. Also
    added the class-level method setDefaultWhitespaceChars(), to allow
    users to override the default set of whitespace characters (space, tab,
    newline, and return) for all subsequently defined ParseElements.
    (Inspired by Klaas Hofstra's inquiry on the Sourceforge pyparsing
    forum.)

    - Added helper parse actions to support some very common parse
    action use cases:
    ... replaceWith(replStr) - replaces the matching tokens with the
    provided replStr replacement string; especially useful with
    transformString()
    ... removeQuotes - removes first and last character from string enclosed
    in quotes (note - NOT the same as the string strip() method, as only a
    single quote character is removed at each end)

    - Added copy() method to ParseElement, to make it easier to define
    different parse actions for the same basic parse expression. (Note,
    copy is implicitly called when using setResultsName().)


    (The following changes were posted to CVS as Version 1.2.3 -
    October-December, 2004)

    - Added support for Unicode strings in creating grammar definitions.
    (Big thanks to Gavin Panella!)

    - Added constant alphas8bit to include the following 8-bit characters:
    ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ

    - Added srange() function to simplify definition of Word elements,
    using regexp-like '[A-Za-z0-9]' syntax. This also simplifies
    referencing common 8-bit characters.

    - Fixed bug in Dict when a single element Dict was embedded within
    another Dict. (Thanks Andy Yates for catching this one!)

    - Added 'formatted' argument to ParseResults.asXML(). If set to False,
    suppresses insertion of whitespace for pretty-print formatting.
    Default equals True for backward compatibility.

    - Added setDebugActions() function to ParserElement, to allow
    user-defined debugging actions.

    - Added support for escaped quotes (either in \', \", or doubled quote
    form) to the predefined expressions for quoted strings. (Thanks, Ero
    Carrera!)

    - Minor performance improvement (~5%) converting "char in string" tests
    to "char in dict". (Suggested by Gavin Panella, cool idea!)


    You can download pyparsing at http://pyparsing.sourceforge.net.

    Enjoy!
    -- Paul McGuire
    Paul McGuire, Mar 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul McGuire

    ANN: pyparsing 1.0.4 released

    Paul McGuire, Jan 9, 2004, in forum: Python
    Replies:
    0
    Views:
    298
    Paul McGuire
    Jan 9, 2004
  2. Paul McGuire

    [ANN] pyparsing 1.2 released

    Paul McGuire, Jun 21, 2004, in forum: Python
    Replies:
    0
    Views:
    269
    Paul McGuire
    Jun 21, 2004
  3. Paul McGuire

    ANN: pyparsing-1.3.1 released

    Paul McGuire, Jun 13, 2005, in forum: Python
    Replies:
    0
    Views:
    267
    Paul McGuire
    Jun 13, 2005
  4. Paul McGuire

    ANN: pyparsing-1.3.1 released

    Paul McGuire, Jun 13, 2005, in forum: Python
    Replies:
    2
    Views:
    303
    Peter Hansen
    Jun 14, 2005
  5. Paul McGuire

    ANN: pyparsing-1.3.3 released

    Paul McGuire, Sep 13, 2005, in forum: Python
    Replies:
    0
    Views:
    295
    Paul McGuire
    Sep 13, 2005
Loading...

Share This Page