Christian Parpart
2018-12-19 11:21:45 +01:00
parent 678a95f6e3
commit d10bae245e
7 changed files with 27 additions and 31 deletions
+2 -2
View File
@@ -100,10 +100,10 @@ void ParserBase::decreaseRecursionDepth()
void ParserBase::parserError(string const& _description)
{
m_errorReporter.parserError(SourceLocation(position(), endPosition(), source()), _description);
m_errorReporter.parserError(SourceLocation{position(), endPosition(), source()}, _description);
}
void ParserBase::fatalParserError(string const& _description)
{
m_errorReporter.fatalParserError(SourceLocation(position(), endPosition(), source()), _description);
m_errorReporter.fatalParserError(SourceLocation{position(), endPosition(), source()}, _description);
}
+2 -6
View File
@@ -38,10 +38,6 @@ namespace langutil
*/
struct SourceLocation
{
SourceLocation(): start(-1), end(-1), source{nullptr} { }
SourceLocation(int _start, int _end, std::shared_ptr<CharStream> _source):
start(_start), end(_end), source{std::move(_source)} { }
bool operator==(SourceLocation const& _other) const
{
return source.get() == _other.source.get() && start == _other.start && end == _other.end;
@@ -53,8 +49,8 @@ struct SourceLocation
bool isEmpty() const { return start == -1 && end == -1; }
int start;
int end;
int start = -1;
int end = -1;
std::shared_ptr<CharStream> source;
};