minilua::SourceChangeAlternative struct

Multiple source changes where only one can be applied (i.e. alternatives).

Supports equality operators.

Base classes

struct CommonSCInfo
Common information for source changes.

Constructors, destructors, conversion operators

SourceChangeAlternative()
Default constructor.
SourceChangeAlternative(std::vector<SourceChangeTree> changes)
Constructor with data.

Public functions

void add(SourceChangeTree)
Add any source change to the alternative.
void add_if_some(std::optional<SourceChangeTree>)
Only add the source change if it is not std::nullopt.
auto simplify() const -> std::optional< SourceChangeTree > -> auto

Public variables

std::vector<SourceChangeTree> changes
The alternatives.

Function documentation

auto minilua::SourceChangeAlternative::simplify() const -> std::optional< SourceChangeTree >

(Recursively) simplifies the tree.

Empty alternatives will be converted to nullopts.