dmd.location
Encapsulates file/line/column locations.
License
Source: location.d
Documentation: https://dlang.org/phobos/dmd_location.html
-
Declaration
enumMessageStyle: ubyte;How code locations are formatted for diagnostic reporting
-
Declaration
digitalmarsfilename.d(line): message
-
Declaration
gnufilename.d:line: message, see https://www.gnu.org/prep/standards/html_node/Errors.html
-
-
Declaration
structLoc;A source code location
Discussion
Used for error messages,
__FILE__and__LINE__tokens,__traits(getLocation, XXX), debug info etc.-
Declaration
const(char)*filename;zero-terminated
filenamestring, either absolute or relative to cwd -
Declaration
uintlinnum;line number, starting from 1
-
Declaration
uintcharnum;utf8 code unit index relative to start of line, starting from 1
-
Declaration
static immutable Locinitial;use for default initialization of const ref Loc's
-
Declaration
static nothrow voidset(boolshowColumns, MessageStylemessageStyle);Configure how display is done
Parameters
boolshowColumnswhen to display columns
MessageStylemessageStyledigitalmars or gnu style messages
-
Declaration
const nothrow boolequals(ref const(Loc)loc);Checks for equivalence by comparing the filename contents (not the pointer) and character location.
Note:
- Uses case-insensitive comparison on Windows
- Ignores
charnumifColumnsisfalse.
-
Declaration
const pure nothrow @nogc @trusted boolopEquals(ref const(Loc)loc);
const pure nothrow @trusted size_ttoHash();/opEquals()for AA key usagetoHash()Discussion
Compare filename contents (case-sensitively on Windows too), not the pointer - a static foreach loop repeatedly mixing in a mixin may lead to multiple equivalent filenames (
foo.d-mixin-<line>), e.g., for test/runnable/test18880.d. -
Declaration
const pure nothrow boolisValid();Return Value
trueif Loc has been set to other than the default initialization
-