OLD | NEW |
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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 | 1238 |
1239 /// Parses a generalized function type. | 1239 /// Parses a generalized function type. |
1240 /// | 1240 /// |
1241 /// The return type must already be pushed. | 1241 /// The return type must already be pushed. |
1242 Token parseFunctionType(Token token) { | 1242 Token parseFunctionType(Token token) { |
1243 assert(optional('Function', token)); | 1243 assert(optional('Function', token)); |
1244 Token functionToken = token; | 1244 Token functionToken = token; |
1245 token = token.next; | 1245 token = token.next; |
1246 token = parseTypeVariablesOpt(token); | 1246 token = parseTypeVariablesOpt(token); |
1247 token = parseFormalParameters(token, MemberKind.GeneralizedFunctionType); | 1247 token = parseFormalParameters(token, MemberKind.GeneralizedFunctionType); |
1248 listener.handleFunctionType(functionToken, token); | 1248 listener.endFunctionType(functionToken, token); |
1249 return token; | 1249 return token; |
1250 } | 1250 } |
1251 | 1251 |
1252 Token parseTypeArgumentsOpt(Token token) { | 1252 Token parseTypeArgumentsOpt(Token token) { |
1253 return parseStuff( | 1253 return parseStuff( |
1254 token, | 1254 token, |
1255 (t) => listener.beginTypeArguments(t), | 1255 (t) => listener.beginTypeArguments(t), |
1256 (t) => parseType(t), | 1256 (t) => parseType(t), |
1257 (c, bt, et) => listener.endTypeArguments(c, bt, et), | 1257 (c, bt, et) => listener.endTypeArguments(c, bt, et), |
1258 (t) => listener.handleNoTypeArguments(t)); | 1258 (t) => listener.handleNoTypeArguments(t)); |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4060 return reportUnrecoverableError( | 4060 return reportUnrecoverableError( |
4061 token, () => code.format(uri, token.charOffset, string)); | 4061 token, () => code.format(uri, token.charOffset, string)); |
4062 } | 4062 } |
4063 } | 4063 } |
4064 | 4064 |
4065 typedef FastaMessage NoArgument(Uri uri, int charOffset); | 4065 typedef FastaMessage NoArgument(Uri uri, int charOffset); |
4066 | 4066 |
4067 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); | 4067 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); |
4068 | 4068 |
4069 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); | 4069 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); |
OLD | NEW |