[Python-checkins] CVS: python/dist/src/Lib sre.py,1.19,1.20

Fredrik Lundh python-dev@python.org
Sun, 2 Jul 2000 16:00:00 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv15713/Lib

Modified Files:
	sre.py 
Log Message:


- changed sre.Scanner to use lastindex instead of index.

Index: sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** sre.py	2000/07/02 17:33:27	1.19
--- sre.py	2000/07/02 22:59:57	1.20
***************
*** 166,170 ****
          for phrase, action in lexicon:
              p.append("(?:%s)(?P#%d)" % (phrase, len(p)))
!         self.scanner = sre.compile("|".join(p))
      def scan(self, string):
          result = []
--- 166,170 ----
          for phrase, action in lexicon:
              p.append("(?:%s)(?P#%d)" % (phrase, len(p)))
!         self.scanner = _compile("|".join(p))
      def scan(self, string):
          result = []
***************
*** 179,183 ****
              if i == j:
                  break
!             action = self.lexicon[m.index][1]
              if callable(action):
                  self.match = match
--- 179,183 ----
              if i == j:
                  break
!             action = self.lexicon[m.lastindex][1]
              if callable(action):
                  self.match = match