minilua::BinaryOrigin struct

Origin for a Value that was created in a binary operation (or some functions with two arguments).

Contents

Support equality operators.

Public functions

auto simplify() const -> Origin -> auto

Public variables

std::shared_ptr<Value> lhs
The first value used to call the binary operator or function.
std::shared_ptr<Value> rhs
The second value used to call the binary operator or function.
std::optional<Range> location
The range of the operator or function call.
std::function<ReverseFn> reverse
The reverse function.

Function documentation

auto minilua::BinaryOrigin::simplify() const -> Origin

Simplify the origin.

Removes unusable origins from the tree.

Variable documentation

std::shared_ptr<Value> minilua::BinaryOrigin::lhs

The first value used to call the binary operator or function.

std::shared_ptr<Value> minilua::BinaryOrigin::rhs

The second value used to call the binary operator or function.

std::function<ReverseFn> minilua::BinaryOrigin::reverse

The reverse function.

Takes as parameters: new_value, old_lhs and old_rhs and returns std::optional<SourceChangeTree>.