sync: minja
This commit is contained in:
parent
4f257550a2
commit
d603d067d5
1 changed files with 7 additions and 2 deletions
|
@ -1270,6 +1270,11 @@ public:
|
|||
}
|
||||
|
||||
auto r = right->evaluate(context);
|
||||
if (op != Op::Eq && op != Op::Ne) {
|
||||
if (r.is_null() || (l.is_null() && (op != Op::In && op != Op::NotIn))) {
|
||||
throw std::runtime_error("unsupported operand type(s)");
|
||||
}
|
||||
}
|
||||
switch (op) {
|
||||
case Op::StrConcat: return l.to_str() + r.to_str();
|
||||
case Op::Add: return l + r;
|
||||
|
@ -2147,11 +2152,11 @@ private:
|
|||
}
|
||||
|
||||
std::runtime_error unexpected(const TemplateToken & token) const {
|
||||
return std::runtime_error("Unexpected " + TemplateToken::typeToString(token.type)
|
||||
return std::runtime_error("Encountered unknown tag '" + TemplateToken::typeToString(token.type) + "'"
|
||||
+ error_location_suffix(*template_str, token.location.pos));
|
||||
}
|
||||
std::runtime_error unterminated(const TemplateToken & token) const {
|
||||
return std::runtime_error("Unterminated " + TemplateToken::typeToString(token.type)
|
||||
return std::runtime_error("Unexpected end of template. Jinja was looking for the following tags: '" + TemplateToken::typeToString(token.type) + "'"
|
||||
+ error_location_suffix(*template_str, token.location.pos));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue