Commits

Anonymous committed f150e14

bugfix: endl and blank

  • Participants
  • Parent commits dd9f221
  • Tags 2.4.0

Comments (0)

Files changed (1)

File pypeg2/__init__.py

     return _card(-3, thing)
 
 
-def endl(thing, parser):
-    """End of line marker for composing text."""
-    return "\n"
+endl = lambda thing, parser: "\n"
+"""End of line marker for composing text."""
 
 
-def blank(thing, parser):
-    """Space marker for composing text."""
-    return " "
+blank = lambda thing, parser: " "
+"""Space marker for composing text."""
 
 
 class GrammarError(Exception):
             if grammar == endl:
                 result = endl(thing, self)
                 self._got_endl = True
-            elif grammar = blank:
-                result = terminal_indent() + blank()
+            elif grammar == blank:
+                result = terminal_indent() + blank(thing, self)
             else:
                 result = self.compose(thing, grammar(thing, self))