class
#include <slang/text/SourceLocation.h>
SourceLocation This class represents a location in source code (or within a macro expansion). The SourceManager can decode this into file, line, and column information if it's a file location, or into expanded and original locations if it's a macro location.
Public static variables
- static const SourceLocation NoLocation
- A location that is reserved to represent "no location" at all.
Constructors, destructors, conversion operators
- operator bool() const explicit
Public functions
Function documentation
slang:: SourceLocation:: operator bool() const explicit
Returns | true if the location is valid, and false if not. |
---|
size_t slang:: SourceLocation:: offset() const
Returns | the character offset of this location within the source buffer. |
---|
bool slang:: SourceLocation:: valid() const
Returns | true if the location is valid, and false if not. |
---|
template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
SourceLocation slang:: SourceLocation:: operator+(T delta) const
Computes a source location that is offset from the current one. Note that there is no error checking to ensure that the location still points to a valid place in the source.