luaur-ast 0.1.0

Lexer, parser, and AST for Luau (faithful Rust port).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! `Location::Location(const Position& begin, unsigned int length)` — Location.h:80.

use crate::records::location::Location;
use crate::records::position::Position;

impl Location {
    /// `end = Position(begin.line, begin.column + length)`.
    pub fn with_length(begin: Position, length: u32) -> Location {
        Location {
            begin,
            end: Position {
                line: begin.line,
                column: begin.column + length,
            },
        }
    }
}