Modified:
branches/groups/src/esmre.py
Log:
Refactor: extract methods from RootState.process_byte.
Modified: branches/groups/src/esmre.py
==============================================================================
--- branches/groups/src/esmre.py (original)
+++ branches/groups/src/esmre.py Wed Oct 1 08:26:13 2008
@@ -84,6 +84,10 @@
self.to_append = ""
def process_byte(self, ch):
+ self.update_hints(ch)
+ return self.next_state(ch)
+
+ def update_hints(self, ch):
if ch in "?*":
self.to_append = ""
self.hints.append("")
@@ -110,10 +114,8 @@
self.hints[-1] += self.to_append
self.to_append = ch
-
-
-
-
+
+ def next_state(self, ch):
if ch == "(":
return InGroupState(self)