-- fixed width calculations for alternations

-- fixed literal check in branch operator
   (this broke test_tokenize, as reported by Mark Favas)
-- added REPEAT_ONE operator (still not enabled, though)
-- added some debugging stuff (maxlevel)
This commit is contained in:
Fredrik Lundh 2000-08-01 21:05:41 +00:00
parent 329e29198d
commit 2f2c67d7e5
4 changed files with 199 additions and 35 deletions

View file

@ -137,12 +137,12 @@ class SubPattern:
lo = hi = 0L
for op, av in self.data:
if op is BRANCH:
l = sys.maxint
h = 0
i = sys.maxint
j = 0
for av in av[1]:
i, j = av.getwidth()
l = min(l, i)
h = min(h, j)
l, h = av.getwidth()
i = min(i, l)
j = min(j, h)
lo = lo + i
hi = hi + j
elif op is CALL: