Modgrammar 0.8 released!

20 views
Skip to first unread message

Alex Stewart

unread,
Dec 23, 2011, 12:57:11 AM12/23/11
to modgrammar
Hi folks!

Modgrammar 0.8 is now officially released.

New in this release:
* Added a NOT_FOLLOWED_BY grammar construct, which will produce an
(empty) successful match as long as the next text in the input does
NOT match the specified grammar.
* Added a grammar_error_override attribute which can be set in order
to make failures in subgrammars be reported as the parent grammar
instead.
* There is a new GrammarParser.skip() method, which can be used to
skip over input in the buffer.

Issues fixed in this release:
* Issue 1: matchtype="longest" or "shortest" breaks when possible
matches are the same length.
* Issue 2: GrammarDefError wasn't actually defined anywhere
* Issue 3: Misc documentation fixups
* Issue 4: Whitespace before EOF confused parse_lines

NOTE: There are a couple of minor API changes in this release which
may affect some users:
* Using matchtype="all" no longer auto-advances the buffer position
when returning matches. You must manually call skip() after each
match to tell the parser how far you want it to skip forward (this
way, you can tell it to skip the right amount depending on which match
you actually choose to use).
* Using len() on a result object now returns the length of the
matched string (previously it returned the length of the list of sub-
elements, but I suspect this way will be generally more useful for
most users).

(Thanks to Hilton Medeiros for helping fix some of the above bugs)

Enjoy!

--Alex
Reply all
Reply to author
Forward
0 new messages