| 429 | } |
| 430 | |
| 431 | std::unique_ptr<ParsedExpression> Transformer::transformListLiteral( |
| 432 | CypherParser::OC_ListLiteralContext& ctx) { |
| 433 | auto listCreation = |
| 434 | std::make_unique<ParsedFunctionExpression>(ListCreationFunction::name, ctx.getText()); |
| 435 | if (ctx.oC_Expression() == nullptr) { // empty list |
| 436 | return listCreation; |
| 437 | } |
| 438 | listCreation->addChild(transformExpression(*ctx.oC_Expression())); |
| 439 | for (auto& listEntry : ctx.iC_ListEntry()) { |
| 440 | if (listEntry->oC_Expression() == nullptr) { |
| 441 | auto nullValue = Value::createNullValue(); |
| 442 | listCreation->addChild( |
| 443 | std::make_unique<ParsedLiteralExpression>(nullValue, nullValue.toString())); |
| 444 | } else { |
| 445 | listCreation->addChild(transformExpression(*listEntry->oC_Expression())); |
| 446 | } |
| 447 | } |
| 448 | return listCreation; |
| 449 | } |
| 450 | |
| 451 | std::unique_ptr<ParsedExpression> Transformer::transformStructLiteral( |
| 452 | CypherParser::IC_StructLiteralContext& ctx) { |