Show More
@@ -127,9 +127,9 def tokenize(program, start, end): | |||
|
127 | 127 | pos += 1 |
|
128 | 128 | yield ('end', None, pos) |
|
129 | 129 | |
|
130 |
def |
|
|
130 | def _parsetemplate(tmpl, start, stop): | |
|
131 | 131 | parsed = [] |
|
132 | pos, stop = 0, len(tmpl) | |
|
132 | pos = start | |
|
133 | 133 | p = parser.parser(elements) |
|
134 | 134 | while pos < stop: |
|
135 | 135 | n = tmpl.find('{', pos, stop) |
@@ -148,7 +148,10 def compiletemplate(tmpl, context): | |||
|
148 | 148 | |
|
149 | 149 | parseres, pos = p.parse(tokenize(tmpl, n + 1, stop)) |
|
150 | 150 | parsed.append(parseres) |
|
151 | return parsed, pos | |
|
151 | 152 | |
|
153 | def compiletemplate(tmpl, context): | |
|
154 | parsed, pos = _parsetemplate(tmpl, 0, len(tmpl)) | |
|
152 | 155 | return [compileexp(e, context, methods) for e in parsed] |
|
153 | 156 | |
|
154 | 157 | def compileexp(exp, context, curmethods): |
General Comments 0
You need to be logged in to leave comments.
Login now