We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d08d3ee commit 6aa9e67Copy full SHA for 6aa9e67
liblangutil/SourceLocation.h
@@ -69,6 +69,15 @@ struct SourceLocation
69
70
bool isEmpty() const { return start == -1 && end == -1; }
71
72
+ bool hasSource() const noexcept { return charStream; }
73
+ bool hasSourceName() const noexcept { return charStream && !charStream->filename().empty(); }
74
+
75
+ std::string const& sourceName() const
76
+ {
77
+ static std::string const empty;
78
+ return charStream ? charStream->filename() : empty;
79
+ }
80
81
int start;
82
int end;
83
std::shared_ptr<CharStream> source;
0 commit comments