![]() |
Spicy
|
#include <location.h>
Public Member Functions | |
| Location (hilti::rt::filesystem::path file="", int from_line=-1, int to_line=-1, int from_character=-1, int to_character=-1) | |
| Location (const Location &)=default | |
| Location (Location &&)=default | |
| Location & | operator= (const Location &)=default |
| Location & | operator= (Location &&)=default |
| auto | file () const |
| auto | from () const |
| auto | to () const |
| Location | merge (const Location &loc) const |
| std::string | dump (bool no_path=false) const |
| operator bool () const | |
| operator std::string () const | |
| bool | operator< (const Location &other) const |
| bool | operator== (const Location &other) const |
Friends | |
| struct | std::hash< Location > |
Source code locations associated with AST nodes.
|
inline |
Constructor. If all arguments are left at their default, the instance will match location::None.
| file | file name/path associated with the location; empty if unknown. |
| from_line | first line number of the described range; -1 if not available. |
| to_line | last line number of the described range; -1 if not available. |
| from_character | first character number of the described range; -1 if not available. |
| to_character | first character number of the described range; -1 if not available. |
| std::string Location::dump | ( | bool | no_path = false | ) | const |
Returns a string representation of the location.
| no_path | if true, do not include the file |
Merges this Location with the provided location. Returns new a location which encompasses the entire span.
|
explicit |
Returns true if the location is set. A location is unset if it equals location::None (which a default constructed location will)..
|
inline |
Forwards to dump().