comparison markup/path.py @ 211:e5151983df0d trunk

Fix another regression introduced in [258]: some kinds of cascaded match templates were broken, for example in the TurboGears example app.
author cmlenz
date Tue, 29 Aug 2006 21:14:58 +0000
parents 13909179e5e1
children 94120e6b0ce4
comparison
equal deleted inserted replaced
210:9fd7535883f2 211:e5151983df0d
149 """ 149 """
150 paths = [(steps, len(steps), [0]) for steps in self.paths] 150 paths = [(steps, len(steps), [0]) for steps in self.paths]
151 151
152 def _test(kind, data, pos, variables): 152 def _test(kind, data, pos, variables):
153 for steps, size, stack in paths: 153 for steps, size, stack in paths:
154 if kind is END:
155 if stack:
156 stack.pop()
157 continue
158 elif kind is START:
159 stack.append(stack and stack[-1] or 0)
160
154 if not stack: 161 if not stack:
155 continue 162 continue
156 cursor = stack[-1] 163 cursor = stack[-1]
157
158 if kind is END:
159 stack.pop()
160 continue
161 elif kind is START:
162 stack.append(cursor)
163 164
164 while 1: 165 while 1:
165 axis, nodetest, predicates = steps[cursor] 166 axis, nodetest, predicates = steps[cursor]
166 167
167 matched = nodetest(kind, data, pos, variables) 168 matched = nodetest(kind, data, pos, variables)
Copyright (C) 2012-2017 Edgewall Software