Track expression dependencies (#2113)

This commit is contained in:
Tim Sylvester
2024-03-07 10:36:50 -08:00
committed by GitHub
parent 9614b566d8
commit 25678a4d99
105 changed files with 1082 additions and 339 deletions

View File

@@ -353,7 +353,7 @@ void testHasOverrides(LayoutType& layout) {
// Expression, overridden text-color.
FormatExpressionSection section(literal(""));
section.setTextSectionOptions(std::nullopt, std::nullopt, toColor(literal("red")));
section.setTextSectionOptions({}, {}, toColor(literal("red")));
auto formatExprOverride = std::make_unique<FormatExpression>(std::vector<FormatExpressionSection>{section});
PropertyExpression<Formatted> propExprOverride(std::move(formatExprOverride));
layout.template get<TextField>() = PropertyValueType<Formatted>(std::move(propExprOverride));
@@ -362,7 +362,7 @@ void testHasOverrides(LayoutType& layout) {
// Nested expressions, overridden text-color.
auto formattedExpr1 = format("first paragraph");
FormatExpressionSection secondParagraph(literal("second paragraph"));
secondParagraph.setTextSectionOptions(std::nullopt, std::nullopt, toColor(literal("blue")));
secondParagraph.setTextSectionOptions({}, {}, toColor(literal("blue")));
std::vector<FormatExpressionSection> sections{{std::move(secondParagraph)}};
auto formattedExpr2 = std::make_unique<FormatExpression>(std::move(sections));
std::unordered_map<std::string, std::shared_ptr<Expression>> branches{{"1st", std::move(formattedExpr1)},