Commits

Anonymous committed 2f65438

how_many() bug: parsing an object has to return 1

  • Participants
  • Parent commits eeb4fc7

Comments (0)

Files changed (1)

File pypeg2/__init__.py

         return reduce(lambda a, b: max(how_many(a), how_many(b)), grammar)
 
     elif _issubclass(grammar, object):
-        try:
-            grammar.grammar
-        except AttributeError:
-            if subclass(grammar, list) or subclass(grammar, Namespace):
-                return 2
-            else:
-                return 1
-        else:
-            return how_many(grammar.grammar)
+        return 1
 
     else:
         raise GrammarTypeError("grammar contains an illegal type: "