[esmre commit] r40 - branches/groups/src

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 1, 2008, 11:27:17 AM10/1/08
to esmre-c...@googlegroups.com
Author: wharris
Date: Wed Oct 1 08:26:13 2008
New Revision: 40

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)

Reply all
Reply to author
Forward
0 new messages