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

Side by Side Diff: pkg/compiler/lib/compiler_new.dart

Issue 1247773002: Add access the Message in CompilerDiagnostics.report. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/apiimpl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// New Compiler API. This API is under construction, use only internally or 5 /// New Compiler API. This API is under construction, use only internally or
6 /// in unittests. 6 /// in unittests.
7 7
8 library compiler_new; 8 library compiler_new;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 /// Interface for receiving diagnostic message from the compiler. That is, 60 /// Interface for receiving diagnostic message from the compiler. That is,
61 /// errors, warnings, hints, etc. 61 /// errors, warnings, hints, etc.
62 abstract class CompilerDiagnostics { 62 abstract class CompilerDiagnostics {
63 /// Invoked by the compiler to report diagnostics. If [uri] is `null`, so are 63 /// Invoked by the compiler to report diagnostics. If [uri] is `null`, so are
64 /// [begin] and [end]. No other arguments may be `null`. If [uri] is not 64 /// [begin] and [end]. No other arguments may be `null`. If [uri] is not
65 /// `null`, neither are [begin] and [end]. [uri] indicates the compilation 65 /// `null`, neither are [begin] and [end]. [uri] indicates the compilation
66 /// unit from where the diagnostic originates. [begin] and [end] are 66 /// unit from where the diagnostic originates. [begin] and [end] are
67 /// zero-based character offsets from the beginning of the compilation unit. 67 /// zero-based character offsets from the beginning of the compilation unit.
68 /// [message] is the diagnostic message, and [kind] indicates indicates what 68 /// [message] is the diagnostic message, and [kind] indicates indicates what
69 /// kind of diagnostic it is. 69 /// kind of diagnostic it is.
70 void report(Uri uri, int begin, int end, String message, Diagnostic kind); 70 ///
71 /// Experimental: [code] is gives access to an id for the messages. Currently
karlklose 2015/07/21 11:25:31 '[code] gives' (remove 'is').
Johnni Winther 2015/07/21 13:51:58 Done.
72 /// it is the [Message] used to create the diagnostic, if available, from
73 /// which the [MessageKind] is accessible.
74 void report(var code,
75 Uri uri, int begin, int end, String text, Diagnostic kind);
71 } 76 }
72 77
73 /// Information resulting from the compilation. 78 /// Information resulting from the compilation.
74 class CompilationResult { 79 class CompilationResult {
75 /// `true` if the compilation succeeded, that is, compilation didn't fail due 80 /// `true` if the compilation succeeded, that is, compilation didn't fail due
76 /// to compile-time errors and/or internal errors. 81 /// to compile-time errors and/or internal errors.
77 final bool isSuccess; 82 final bool isSuccess;
78 83
79 /// The compiler object used for the compilation. 84 /// The compiler object used for the compilation.
80 /// 85 ///
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 compilerOptions.libraryRoot, 175 compilerOptions.libraryRoot,
171 compilerOptions.packageRoot, 176 compilerOptions.packageRoot,
172 compilerOptions.options, 177 compilerOptions.options,
173 compilerOptions.environment, 178 compilerOptions.environment,
174 compilerOptions.packageConfig, 179 compilerOptions.packageConfig,
175 compilerOptions.packagesDiscoveryProvider); 180 compilerOptions.packagesDiscoveryProvider);
176 return compiler.run(compilerOptions.entryPoint).then((bool success) { 181 return compiler.run(compilerOptions.entryPoint).then((bool success) {
177 return new CompilationResult(compiler, isSuccess: success); 182 return new CompilationResult(compiler, isSuccess: success);
178 }); 183 });
179 } 184 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/apiimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698