mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:31:04 +01:00
Add location information to diagnostics. (#385)
Add simple mocking and testing of diagnostic emission to ensure this works.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user