minilua::Range struct

A range (sometimes called span) in source code.

Contents

Supports equality operators.

Public functions

auto with_file(std::optional<std::shared_ptr<const std::string>> file) const -> Range -> auto

Public variables

Location start
Start of the range.
Location end
End of the range (exclusive).
std::optional<std::shared_ptr<const std::string>> file

Function documentation

auto minilua::Range::with_file(std::optional<std::shared_ptr<const std::string>> file) const -> Range

Returns a copy of this range with the filename changed.

Variable documentation

std::optional<std::shared_ptr<const std::string>> minilua::Range::file

Optional filename where the Range is located.

The filename is behind a shared_ptr to avoid unnecessary copies.