Module span

Source
Expand description

Span (Span) and error (Error) related implementations.

In laps, Span represents a region of the input characters, which consists of a start location and an end location. Location is a line-column pair.

For example, for the following input:

The quick brown fox
jumps over the lazy dog.

Span 1:5-1:9 corresponds to:

The quick brown fox
    ^^^^^
jumps over the lazy dog.

Span 1:17-2:10 corresponds to:

The quick brown fox
                ^^^
jumps over the lazy dog.
^^^^^^^^^^

Structs§

Location
A line-column mark.
Span
A span that records source code locations.

Enums§

Errorlogger
The type of error returned by logger methods of Span.
FileType
Type of input file.

Traits§

LocationUpdate
Trait for updating a location with a specific character type.
Spanned
Trait for getting span from objects.
TrySpan
Trait for getting span from objects that may not contain a span.

Type Aliases§

Result
A specialized Result type for lexers and parsers.

Derive Macros§

Spannedmacros
Generates the Spanned trait implementation.