MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / transformListLiteral

Method transformListLiteral

src/parser/transform/transform_expression.cpp:431–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431std::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
451std::unique_ptr<ParsedExpression> Transformer::transformStructLiteral(
452 CypherParser::IC_StructLiteralContext& ctx) {

Callers

nothing calls this directly

Calls 2

addChildMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected