Source structv0.1.0
The location of the expression that reads it.
pub struct Source {
pub line: uint;
pub column: uint;
pub file: char8[..];
pub fileName: char8[..];
pub filePath: char8[..];
pub function: char8[..];
pub module: char8[..];
}
Every field is fixed while compiling, from the read's own position. A field read produces no runtime code beyond the constant it folds to; the text fields borrow the compiler's own storage, which outlives the program.
Fields
| Name | Type | Description |
|---|---|---|
line | uint | The one-based line of the reading expression. |
column | uint | The one-based column of the reading expression. |
file | char8[..] | The source file as the build named it, which is the spelling a diagnostic uses. |
fileName | char8[..] | The file's last path component, with its extension. |
filePath | char8[..] | The file's path, relative to the package root where the file belongs to one. |
function | char8[..] | The enclosing function, qualified with its type for a method. |
module | char8[..] | The enclosing module path, relative to the package root. |
Related
#source
pub const #source: Source;
The reading expression's own location, as a compile-time value.