diff --git a/src/expression_parser.cpp b/src/expression_parser.cpp index edc599c..c892936 100644 --- a/src/expression_parser.cpp +++ b/src/expression_parser.cpp @@ -370,7 +370,7 @@ ExpressionParser::ParseResult> ExpressionPars ExpressionEvaluatorPtr result; std::unordered_map> items; - if (lexer.EatIfEqual(']')) + if (lexer.EatIfEqual('}')) return std::make_shared(std::move(items)); do diff --git a/test/expressions_test.cpp b/test/expressions_test.cpp index b528102..33f044a 100644 --- a/test/expressions_test.cpp +++ b/test/expressions_test.cpp @@ -100,6 +100,19 @@ rain }; } +MULTISTR_TEST(ExpressionsMultiStrTest, EmptyDict, +R"( +{% set d = {} %} +{{ d.asdf|default(42) }} +)", +//----------- +R"( + +42 +)") +{ +} + TEST(ExpressionTest, DoStatement) { std::string source = R"(