Skip to main content

luaur_ast/methods/
location_location_location_alt_c.rs

1//! `Location::Location(const Position& begin, unsigned int length)` — Location.h:80.
2
3use crate::records::location::Location;
4use crate::records::position::Position;
5
6impl Location {
7    /// `end = Position(begin.line, begin.column + length)`.
8    pub fn with_length(begin: Position, length: u32) -> Location {
9        Location {
10            begin,
11            end: Position {
12                line: begin.line,
13                column: begin.column + length,
14            },
15        }
16    }
17}