head = mydeparray.pop(0)
if type(head) == types.ListType:
- rlist = rlist + [use_reduce(head, uselist, masklist, matchall, excludeall)]
+ additions = use_reduce(head, uselist, masklist, matchall, excludeall)
+ if additions:
+ rlist.append(additions)
else:
if head[-1] == "?": # Use reduce next group on fail.
if ismatch:
target = newdeparray[-1]
if isinstance(target, list):
- rlist += [use_reduce(target, uselist, masklist, matchall, excludeall)]
+ additions = use_reduce(target, uselist, masklist, matchall, excludeall)
+ if additions:
+ rlist.append(additions)
else:
rlist += [target]