| 1196 | ArrayExpr(const Location & loc, std::vector<std::shared_ptr<Expression>> && e) |
| 1197 | : Expression(loc), elements(std::move(e)) {} |
| 1198 | Value do_evaluate(const std::shared_ptr<Context> & context) const override { |
| 1199 | auto result = Value::array(); |
| 1200 | for (const auto& e : elements) { |
| 1201 | if (!e) throw std::runtime_error("Array element is null"); |
| 1202 | result.push_back(e->evaluate(context)); |
| 1203 | } |
| 1204 | return result; |
| 1205 | } |
| 1206 | }; |
| 1207 | |
| 1208 | class DictExpr : public Expression { |