Struct esparse::ast::Loc [] [src]

pub struct Loc {
    pub pos: usize,
    pub row: usize,
    pub col: usize,
}

A location in source code.

Stores both the bytewise position and the logical line and character numbers.

Fields

0-based byte index.

0-based line number.

0-based character number on the line.

Methods

impl Loc
[src]

Creates a new Loc with the given positions.

Creates a new Loc pointing to the first byte of the source code (pos, row, and col all zero).

Trait Implementations

impl Debug for Loc
[src]

Formats the value using the given formatter.

impl Clone for Loc
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Loc
[src]

impl PartialEq for Loc
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Loc
[src]

impl Hash for Loc
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for Loc
[src]

Returns the "default value" for a type. Read more