minilua::UnaryOrigin struct

Origin for a Value that was created in a unary operation (or some functions with one argument).

Contents

Support equality operators.

Public functions

auto simplify() const -> Origin -> auto

Public variables

std::shared_ptr<Value> val
The value used to call the unary 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::UnaryOrigin::simplify() const -> Origin

Simplify the origin.

Removes unusable origins from the tree.

Variable documentation

std::shared_ptr<Value> minilua::UnaryOrigin::val

The value used to call the unary operator or function.

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

The reverse function.

Takes as parameters: new_value and old_value and returns std::optional<SourceChangeTree>.