Add location information to diagnostics. (#385)

Add simple mocking and testing of diagnostic emission to ensure this
works.
This commit is contained in:
Richard Smith authored and GitHub committed 2021-03-18 21:05:54 -07:00
1 parent b2455d8dba
commit d1757d9979
26 files changed
+621 -172

No files matched your search

+4 -1
View File
@@ -19,8 +19,11 @@
namespace Carbon {
auto ParseTree::Parse(TokenizedBuffer& tokens, DiagnosticEmitter& emitter)
auto ParseTree::Parse(TokenizedBuffer& tokens, DiagnosticConsumer& consumer)
-> ParseTree {
TokenizedBuffer::TokenLocationTranslator translator(tokens);
TokenDiagnosticEmitter emitter(translator, consumer);
// Delegate to the parser.
return Parser::Parse(tokens, emitter);
}