##// END OF EJS Templates
templater: make sure expression is terminated by '}'...
Yuya Nishihara -
r35698:077ee15b default
parent child Browse files
Show More
@@ -184,6 +184,8 b' def _parsetemplate(tmpl, start, stop, qu'
184 return parsed, n + 1
184 return parsed, n + 1
185
185
186 parseres, pos = p.parse(tokenize(tmpl, n + 1, stop, '}'))
186 parseres, pos = p.parse(tokenize(tmpl, n + 1, stop, '}'))
187 if not tmpl.endswith('}', n + 1, pos):
188 raise error.ParseError(_("invalid token"), pos)
187 parsed.append(parseres)
189 parsed.append(parseres)
188
190
189 if quote:
191 if quote:
@@ -2756,6 +2756,15 b' Error on syntax:'
2756 $ hg log -T '{date'
2756 $ hg log -T '{date'
2757 hg: parse error at 1: unterminated template expansion
2757 hg: parse error at 1: unterminated template expansion
2758 [255]
2758 [255]
2759 $ hg log -T '{date(}'
2760 hg: parse error at 7: not a prefix: end
2761 [255]
2762 $ hg log -T '{date)}'
2763 hg: parse error at 5: invalid token
2764 [255]
2765 $ hg log -T '{date date}'
2766 hg: parse error at 6: invalid token
2767 [255]
2759
2768
2760 Behind the scenes, this will throw TypeError
2769 Behind the scenes, this will throw TypeError
2761
2770
General Comments 0
You need to be logged in to leave comments. Login now