Skip to content

Commit 6e676c8

Browse files
author
ochafik
committed
sync: minja
1 parent ba27e98 commit 6e676c8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

common/minja.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ class Context : public std::enable_shared_from_this<Context> {
628628
if (parent_) return parent_->contains(key);
629629
return false;
630630
}
631-
virtual void set(const Value & key, Value & value) {
631+
virtual void set(const Value & key, const Value & value) {
632632
values_.set(key, value);
633633
}
634634
};
@@ -1270,11 +1270,6 @@ class BinaryOpExpr : public Expression {
12701270
}
12711271

12721272
auto r = right->evaluate(context);
1273-
// if (op != Op::Eq && op != Op::Ne) {
1274-
// if (r.is_null() || (l.is_null() && (op != Op::In && op != Op::NotIn))) {
1275-
// throw std::runtime_error("unsupported operand type(s): " + l.type() + " and " + r.type());
1276-
// }
1277-
// }
12781273
switch (op) {
12791274
case Op::StrConcat: return l.to_str() + r.to_str();
12801275
case Op::Add: return l + r;
@@ -2152,11 +2147,11 @@ class Parser {
21522147
}
21532148

21542149
std::runtime_error unexpected(const TemplateToken & token) const {
2155-
return std::runtime_error("Encountered unknown tag '" + TemplateToken::typeToString(token.type) + "'"
2150+
return std::runtime_error("Unexpected " + TemplateToken::typeToString(token.type)
21562151
+ error_location_suffix(*template_str, token.location.pos));
21572152
}
21582153
std::runtime_error unterminated(const TemplateToken & token) const {
2159-
return std::runtime_error("Unexpected end of template. Jinja was looking for the following tags: '" + TemplateToken::typeToString(token.type) + "'"
2154+
return std::runtime_error("Unterminated " + TemplateToken::typeToString(token.type)
21602155
+ error_location_suffix(*template_str, token.location.pos));
21612156
}
21622157

0 commit comments

Comments
 (0)