comparison markup/template.py @ 116:c77c113846d6 trunk

Merged [135:138/branches/experimental/cspeedups].
author cmlenz
date Tue, 01 Aug 2006 17:06:03 +0000
parents 2368c3becc52
children c9f0a26e28a2
comparison
equal deleted inserted replaced
115:e92fb402ee04 116:c77c113846d6
934 yield kind, data, pos 934 yield kind, data, pos
935 continue 935 continue
936 936
937 for idx, (test, path, template, directives) in \ 937 for idx, (test, path, template, directives) in \
938 enumerate(match_templates): 938 enumerate(match_templates):
939 result = test(kind, data, pos) 939
940 940 if test(kind, data, pos) is True:
941 if result:
942 # Consume and store all events until an end event 941 # Consume and store all events until an end event
943 # corresponding to this start event is encountered 942 # corresponding to this start event is encountered
944 content = [(kind, data, pos)] 943 content = [(kind, data, pos)]
945 depth = 1 944 depth = 1
946 while depth > 0: 945 while depth > 0:
959 template = _apply_directives(template, ctxt, directives) 958 template = _apply_directives(template, ctxt, directives)
960 for event in self._match(self._eval(template, ctxt), 959 for event in self._match(self._eval(template, ctxt),
961 ctxt, match_templates[:idx] + 960 ctxt, match_templates[:idx] +
962 match_templates[idx + 1:]): 961 match_templates[idx + 1:]):
963 yield event 962 yield event
963
964 ctxt.pop() 964 ctxt.pop()
965
966 break 965 break
967 966
968 else: # no matches 967 else: # no matches
969 yield kind, data, pos 968 yield kind, data, pos
970 969
Copyright (C) 2012-2017 Edgewall Software