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
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 @nogc @safe uintcharnum();
nothrow @nogc @safe uintcharnum(uintnum);utf8 code unit index relative to start of line, starting from 1
-
Declaration
const nothrow @nogc @safe uintlinnum();
nothrow @nogc @safe uintlinnum(uintnum);line number, starting from 1
-
Declaration
const nothrow @nogc const(char)*filename();Return Value
filenamefor this location,nullif none -
Declaration
nothrow @trusted voidfilename(const(char)*name);Set file
namefor this locationParameters
const(char)*namefile
namefor location,nullfor no filename -
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 nothrow @nogc @trusted boolopEquals(ref const(Loc)loc);
const 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 @safe boolisValid();Return Value
trueif Loc has been set to other than the default initialization
-