13 namespace expression {
17 using Bindings = std::map<std::string, std::shared_ptr<Expression>>;
19 Let(
Bindings bindings_, std::unique_ptr<Expression> result_) :
21 bindings(
std::move(bindings_)),
22 result(
std::move(result_))
32 auto rhs =
static_cast<const Let*
>(&e);
33 return *result == *(rhs->result);
48 std::unique_ptr<Expression> result;
63 auto rhs =
static_cast<const Var*
>(&e);
64 return *value == *(rhs->value);
78 std::shared_ptr<Expression> value;
type::Type getType() const
mbgl::Value serialize() const override
bool operator==(const Expression &e) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &, ParsingContext &)
std::vector< std::optional< Value > > possibleOutputs() const override
std::map< std::string, std::shared_ptr< Expression > > Bindings
EvaluationResult evaluate(const EvaluationContext ¶ms) const override
void eachChild(const std::function< void(const Expression &)> &) const override
Expression * getResult() const
std::string getOperator() const override
Let(Bindings bindings_, std::unique_ptr< Expression > result_)
const std::shared_ptr< Expression > & getBoundExpression() const
mbgl::Value serialize() const override
Var(std::string name_, std::shared_ptr< Expression > value_)
EvaluationResult evaluate(const EvaluationContext ¶ms) const override
std::vector< std::optional< Value > > possibleOutputs() const override
void eachChild(const std::function< void(const Expression &)> &) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &, ParsingContext &)
std::string getOperator() const override
bool operator==(const Expression &e) const override
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
std::optional< std::unique_ptr< Expression > > ParseResult
mapbox::base::Value Value