Skip to content

Commit

Permalink
Fix __all__ in expressions module.
Browse files Browse the repository at this point in the history
You couldn't import * from it before, because not all the mentioned symbols were defined.
  • Loading branch information
erikrose committed Apr 6, 2013
1 parent e55636f commit bf7376c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ Version History

0.4
* Python 3 support
* Fix ``import *`` for ``parsimonious.expressions``.

0.3
* Support comments, the ``!`` ("not") operator, and parentheses in grammar
Expand Down
7 changes: 2 additions & 5 deletions parsimonious/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from parsimonious.utils import StrAndRepr


__all__ = ['Expression', 'Literal', 'Regex', 'Sequence', 'OneOf', 'AllOf',
'Not', 'Optional', 'ZeroOrMore', 'OneOrMore', 'ExpressionFlattener']
__all__ = ['Expression', 'Literal', 'Regex', 'Sequence', 'OneOf', 'Lookahead',
'Not', 'Optional', 'ZeroOrMore', 'OneOrMore']


class Expression(StrAndRepr):
Expand All @@ -33,9 +33,6 @@ def parse(self, text):
Return ``None`` if the expression doesn't match the full string.
On a more technical level: initialize the packrat cache and kick off
the first ``match()`` call.
"""
node = self.match(text)
if node is None or node.end - node.start != len(text): # TODO: Why not test just end here? Are we going to add a pos kwarg or something?
Expand Down

0 comments on commit bf7376c

Please sign in to comment.