Mercurial > hg > mercurial-source
diff mercurial/templater.py @ 26341:babd2c93bd99
templater: check existence of closing brace of template string
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 15 Jun 2015 23:03:30 +0900 |
parents | 82c918509ef5 |
children | 1f6878c87c25 |
line wrap: on
line diff
--- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -120,12 +120,12 @@ yield ('symbol', sym, s) pos -= 1 elif c == '}': - pos += 1 - break + yield ('end', None, pos + 1) + return else: raise error.ParseError(_("syntax error"), pos) pos += 1 - yield ('end', None, pos) + raise error.ParseError(_("unterminated template expansion"), start) def _parsetemplate(tmpl, start, stop): parsed = []