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

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

Issue 2932723003: Complain about incorrect use of null-aware operations. (Closed)
Patch Set: 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart ('k') | pkg/front_end/messages.yaml » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.parser.parser; 5 library fasta.parser.parser;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show 8 show
9 FastaCode, 9 FastaCode,
10 FastaMessage, 10 FastaMessage,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 codeInvalidVoid, 44 codeInvalidVoid,
45 codeNoFormals, 45 codeNoFormals,
46 codeNonAsciiIdentifier, 46 codeNonAsciiIdentifier,
47 codeNonAsciiWhitespace, 47 codeNonAsciiWhitespace,
48 codeOnlyTry, 48 codeOnlyTry,
49 codePositionalParameterWithEquals, 49 codePositionalParameterWithEquals,
50 codePrivateNamedParameter, 50 codePrivateNamedParameter,
51 codeRequiredParameterWithDefault, 51 codeRequiredParameterWithDefault,
52 codeSetterNotSync, 52 codeSetterNotSync,
53 codeStackOverflow, 53 codeStackOverflow,
54 codeSuperNullAware,
54 codeTypeAfterVar, 55 codeTypeAfterVar,
55 codeTypeRequired, 56 codeTypeRequired,
56 codeUnexpectedToken, 57 codeUnexpectedToken,
57 codeUnmatchedToken, 58 codeUnmatchedToken,
58 codeUnspecified, 59 codeUnspecified,
59 codeUnsupportedPrefixPlus, 60 codeUnsupportedPrefixPlus,
60 codeUnterminatedString, 61 codeUnterminatedString,
61 codeYieldAsIdentifier, 62 codeYieldAsIdentifier,
62 codeYieldNotGenerator; 63 codeYieldNotGenerator;
63 64
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
3050 3051
3051 Token parseSuperExpression(Token token, IdentifierContext context) { 3052 Token parseSuperExpression(Token token, IdentifierContext context) {
3052 Token beginToken = token; 3053 Token beginToken = token;
3053 listener.handleSuperExpression(token, context); 3054 listener.handleSuperExpression(token, context);
3054 token = token.next; 3055 token = token.next;
3055 if (optional('(', token)) { 3056 if (optional('(', token)) {
3056 // Super constructor. 3057 // Super constructor.
3057 listener.handleNoTypeArguments(token); 3058 listener.handleNoTypeArguments(token);
3058 token = parseArguments(token); 3059 token = parseArguments(token);
3059 listener.endSend(beginToken, token); 3060 listener.endSend(beginToken, token);
3061 } else if (optional("?.", token)) {
3062 reportRecoverableErrorCode(token, codeSuperNullAware);
3060 } 3063 }
3061 return token; 3064 return token;
3062 } 3065 }
3063 3066
3064 /// '[' (expressionList ','?)? ']'. 3067 /// '[' (expressionList ','?)? ']'.
3065 /// 3068 ///
3066 /// Provide [constKeyword] if preceded by 'const', null if not. 3069 /// Provide [constKeyword] if preceded by 'const', null if not.
3067 /// This is a suffix parser because it is assumed that type arguments have 3070 /// This is a suffix parser because it is assumed that type arguments have
3068 /// been parsed, or `listener.handleNoTypeArguments(..)` has been executed. 3071 /// been parsed, or `listener.handleNoTypeArguments(..)` has been executed.
3069 Token parseLiteralListSuffix(Token token, Token constKeyword) { 3072 Token parseLiteralListSuffix(Token token, Token constKeyword) {
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 return reportUnrecoverableError( 4003 return reportUnrecoverableError(
4001 token, () => code.format(uri, token.charOffset, string)); 4004 token, () => code.format(uri, token.charOffset, string));
4002 } 4005 }
4003 } 4006 }
4004 4007
4005 typedef FastaMessage NoArgument(Uri uri, int charOffset); 4008 typedef FastaMessage NoArgument(Uri uri, int charOffset);
4006 4009
4007 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); 4010 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token);
4008 4011
4009 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); 4012 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string);
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698