##// END OF EJS Templates
templater: check existence of closing brace of template string
Yuya Nishihara -
r25782:babd2c93 default
parent child Browse files
Show More
@@ -120,12 +120,12 b' def tokenize(program, start, end):'
120 120 yield ('symbol', sym, s)
121 121 pos -= 1
122 122 elif c == '}':
123 pos += 1
124 break
123 yield ('end', None, pos + 1)
124 return
125 125 else:
126 126 raise error.ParseError(_("syntax error"), pos)
127 127 pos += 1
128 yield ('end', None, pos)
128 raise error.ParseError(_("unterminated template expansion"), start)
129 129
130 130 def _parsetemplate(tmpl, start, stop):
131 131 parsed = []
@@ -2513,6 +2513,10 b' Error on syntax:'
2513 2513 abort: t:3: unmatched quotes
2514 2514 [255]
2515 2515
2516 $ hg log -T '{date'
2517 hg: parse error at 1: unterminated template expansion
2518 [255]
2519
2516 2520 Behind the scenes, this will throw TypeError
2517 2521
2518 2522 $ hg log -l 3 --template '{date|obfuscate}\n'
General Comments 0
You need to be logged in to leave comments. Login now