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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2924363002: Improve error messages. (Closed)
Patch Set: Updates after testing. Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' 10 import '../parser/parser.dart'
(...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 void handleSymbolVoid(Token token) { 2917 void handleSymbolVoid(Token token) {
2918 debugEvent("SymbolVoid"); 2918 debugEvent("SymbolVoid");
2919 push(new Identifier(token)); 2919 push(new Identifier(token));
2920 } 2920 }
2921 2921
2922 @override 2922 @override
2923 dynamic addCompileTimeError(int charOffset, String message, 2923 dynamic addCompileTimeError(int charOffset, String message,
2924 {bool silent: false}) { 2924 {bool silent: false}) {
2925 // TODO(ahe): If constantExpressionRequired is set, set it to false to 2925 // TODO(ahe): If constantExpressionRequired is set, set it to false to
2926 // avoid a long list of errors. 2926 // avoid a long list of errors.
2927 return library.addCompileTimeError(charOffset, message, fileUri: uri); 2927 return library.addCompileTimeError(charOffset, message,
2928 fileUri: uri, silent: silent);
2928 } 2929 }
2929 2930
2930 @override 2931 @override
2931 void handleInvalidFunctionBody(Token token) { 2932 void handleInvalidFunctionBody(Token token) {
2932 if (member.isNative) { 2933 if (member.isNative) {
2933 push(NullValue.FunctionBody); 2934 push(NullValue.FunctionBody);
2934 } else { 2935 } else {
2935 push(new Block(<Statement>[ 2936 push(new Block(<Statement>[
2936 buildCompileTimeErrorStatement("Expected '{'.", token.charOffset) 2937 buildCompileTimeErrorStatement("Expected '{'.", token.charOffset)
2937 ])); 2938 ]));
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 if (starToken == null) { 3475 if (starToken == null) {
3475 return AsyncMarker.Async; 3476 return AsyncMarker.Async;
3476 } else { 3477 } else {
3477 assert(identical(starToken.stringValue, "*")); 3478 assert(identical(starToken.stringValue, "*"));
3478 return AsyncMarker.AsyncStar; 3479 return AsyncMarker.AsyncStar;
3479 } 3480 }
3480 } else { 3481 } else {
3481 return internalError("Unknown async modifier: $asyncToken"); 3482 return internalError("Unknown async modifier: $asyncToken");
3482 } 3483 }
3483 } 3484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698