Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: pkg/compiler/lib/src/parser/partial_elements.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/parser/parser_task.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/partial_elements.dart
diff --git a/pkg/compiler/lib/src/parser/partial_elements.dart b/pkg/compiler/lib/src/parser/partial_elements.dart
index 87041b404d40ead830b32c3942cbb36507aa299e..b0a1b797708915d0dbf013099d030752db21c1a0 100644
--- a/pkg/compiler/lib/src/parser/partial_elements.dart
+++ b/pkg/compiler/lib/src/parser/partial_elements.dart
@@ -7,10 +7,9 @@ library dart2js.parser.partial_elements;
import '../common/resolution.dart' show
Parsing,
Resolution;
-import '../compiler.dart' show
- Compiler;
import '../dart_types.dart' show DynamicType;
-import '../diagnostics/diagnostic_listener.dart';
+import '../diagnostics/diagnostic_listener.dart' show
+ DiagnosticReporter;
import '../diagnostics/invariant.dart' show
invariant;
import '../diagnostics/messages.dart';
@@ -273,8 +272,8 @@ class PartialFieldList extends VariableList with PartialElement {
VariableDefinitions parseNode(Element element, Parsing parsing) {
if (definitions != null) return definitions;
- DiagnosticListener listener = parsing.listener;
- listener.withCurrentElement(element, () {
+ DiagnosticReporter reporter = parsing.reporter;
+ reporter.withCurrentElement(element, () {
definitions = parse(
parsing, element, declarationSite,
(Parser parser) => parser.parseMember(beginToken));
@@ -285,7 +284,7 @@ class PartialFieldList extends VariableList with PartialElement {
!definitions.modifiers.isConst &&
definitions.type == null &&
!definitions.isErroneous) {
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
definitions,
MessageKind.GENERIC,
{ 'text': 'A field declaration must start with var, final, '
@@ -423,10 +422,10 @@ class PartialClassElement extends ClassElementX with PartialElement {
ClassNode parseNode(Parsing parsing) {
if (cachedNode != null) return cachedNode;
- DiagnosticListener diagnosticListener = parsing.listener;
- diagnosticListener.withCurrentElement(this, () {
+ DiagnosticReporter reporter = parsing.reporter;
+ reporter.withCurrentElement(this, () {
parsing.measure(() {
- MemberListener listener = new MemberListener(diagnosticListener, this);
+ MemberListener listener = new MemberListener(reporter, this);
Parser parser = new ClassElementParser(listener);
try {
Token token = parser.parseTopLevelDeclaration(beginToken);
@@ -480,11 +479,11 @@ Node parse(
ElementX element,
PartialElement partial,
doParse(Parser parser)) {
- DiagnosticListener diagnosticListener = parsing.listener;
+ DiagnosticReporter reporter = parsing.reporter;
return parsing.measure(() {
- return diagnosticListener.withCurrentElement(element, () {
+ return reporter.withCurrentElement(element, () {
CompilationUnitElement unit = element.compilationUnit;
- NodeListener listener = new NodeListener(diagnosticListener, unit);
+ NodeListener listener = new NodeListener(reporter, unit);
listener.memberErrors = listener.memberErrors.prepend(false);
try {
if (partial.hasParseError) {
« no previous file with comments | « pkg/compiler/lib/src/parser/parser_task.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698