codemap

Crates.iocodemap
lib.rscodemap
version0.1.3
sourcesrc
created_at2017-05-29 00:18:14.124436
updated_at2020-04-12 17:12:56.718291
descriptionA data structure for efficiently storing source code position and span information (e.g. in a compiler AST), and mapping it back to file/line/column locations for error reporting and suggestions.
homepage
repositoryhttps://github.com/kevinmehall/codemap
max_upload_size
id16695
size28,965
Kevin Mehall (kevinmehall)

documentation

https://docs.rs/codemap

README

CodeMap

Documentation

Build Status

A data structure for tracking source positions in language implementations, inspired by the SourceMap (formerly CodeMap) type in rustc's libsyntax.

The CodeMap tracks all source files and maps positions within them to linear indexes as if all source files were concatenated. This allows a source position to be represented by a small 32-bit Pos indexing into the CodeMap, under the assumption that the total amount of parsed source code will not exceed 4GiB. The CodeMap can look up the source file, line, and column of a Pos or Span, as well as provide source code snippets for error reporting.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 30

cargo fmt