Module xswag_base::code [] [src]

This module contains types and functions to work on the raw source code.

Currently we do not distinguish between code-map and file-map, since one file always contains the whole code so far. However, this might change!

Structs

BytePos

Position within source specified by byte offset. This is not equal to CharPos thanks to UTF-8 and multibyte chars. This type always represents positions relative to the whole codemap.

ColIdx

Represents a column index.

FileMap

Stores the content of a file and keeps track of some position meta data, such as linebreaks.

LineIdx

Represents a line index.

Loc

Location within one file specified by line and column.

Span

A region within the source specified by first and last byte offset. lo byte is included in the span, hi byte is excluded.

Type Definitions

SrcOffset

Type do index one byte in a source code. It should be rather small, since it's used a lot.