pub struct Context {
pub text: String,
pub base: Pos,
pub file_name: String,
pub first_line: usize,
pub dir: Option<PathBuf>,
pub next_base: Pos,
pub target_pragmas: TargetPragmas,
}Expand description
What the preprocessor needs to know about the text it is running over.
Fields§
§text: StringThe C source text, which #error and #include <…> read back
verbatim.
base: PosThe global offset of text’s first byte.
file_name: StringWhat __FILE__ expands to.
first_line: usizeThe line text’s own line 1 sits on; see the module docs.
dir: Option<PathBuf>The directory an #include "…" written in this text looks in first —
the directory of the invoking .rs file. None when the compiler will
not say where that is.
next_base: PosThe global offset the first #included file is placed at.
The preprocessor allocates the offsets of the files it opens, because
it runs where a SourceMap cannot follow it; see
crate::SourceMap::next_base.
target_pragmas: TargetPragmasThe #pragma cinrs target directives scan_target_pragma already
read out of text, so that the preprocessor does not report one twice
and can tell a header’s from the unit’s own.