codespan_preprocessed
This is an extension for the very useful crate codespan_reporting
to deal with preprocessed file through the well-knownm4 or cpp.
Using such a preprocessor allows, among a lost of things, the inclusion of many files which are identified in the bytes sequence with preprecessor directive as:
#line 42 "/my/preprocessed/file"
This directive breaks the location of the source and so should be correctly processed to make correct location for error reporting.
This is the purpose of this crate: taking a preprocessor output and managing the different underlying locations inside it.
Example
use Diagnostic;
use term;
use ;
use PreprocessedFile;
The previous code will produce:
note: this is just an example
┌─ included_file:6:5
│
6 │ the last one
│ ^^^^ do you see that ?
│
┌─ top_file:1:3
│
1 │ a first statement;
│ ----- is it related to this ?