ts::Point struct

Location in source code as row and column.

Contents

Supports the comparison operators.

Public functions

auto pretty(bool start_at_one = false) const -> std::string
Pretty print to string.

Public variables

std::uint32_t row
Row in the source code.
std::uint32_t column
Column in the source code.

Function documentation

std::string ts::Point::pretty(bool start_at_one = false) const

Pretty print to string.

Parameters
start_at_one Default to false. If true the row and column will be printed starting at 1 otherwise it starts at 0.

Returns the Point as a pretty printed string. By default the row and column start at 0 (which is not usually how code locations are counted). If you want the row and column to start at 1 you need to call it with parameter true.