| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// Logic to build unlinked summaries. | 5 /// Logic to build unlinked summaries. |
| 6 library summary.src.summary_builder; | 6 library summary.src.summary_builder; |
| 7 | 7 |
| 8 import 'package:front_end/src/fasta/parser/class_member_parser.dart'; | 8 import 'package:front_end/src/fasta/parser/class_member_parser.dart'; |
| 9 import 'package:front_end/src/fasta/parser/identifier_context.dart'; | 9 import 'package:front_end/src/fasta/parser/identifier_context.dart'; |
| 10 import 'package:front_end/src/fasta/parser/parser.dart'; | 10 import 'package:front_end/src/fasta/parser/parser.dart'; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void endConstructorReference( | 254 void endConstructorReference( |
| 255 Token start, Token periodBeforeName, Token endToken) { | 255 Token start, Token periodBeforeName, Token endToken) { |
| 256 debugEvent("ConstructorReference $start $periodBeforeName"); | 256 debugEvent("ConstructorReference $start $periodBeforeName"); |
| 257 Ref ctorName = popIfNotNull(periodBeforeName); | 257 Ref ctorName = popIfNotNull(periodBeforeName); |
| 258 assert(ctorName?.prefix == null); | 258 assert(ctorName?.prefix == null); |
| 259 List<TypeRef> typeArgs = pop(); | 259 List<TypeRef> typeArgs = pop(); |
| 260 Ref type = pop(); | 260 Ref type = pop(); |
| 261 push(new ConstructorName(new TypeRef(type, typeArgs), ctorName?.name)); | 261 push(new ConstructorName(new TypeRef(type, typeArgs), ctorName?.name)); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void endFormalParameter( | 264 void endFormalParameter(Token covariantKeyword, Token thisKeyword, |
| 265 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { | 265 Token nameToken, FormalParameterType kind) { |
| 266 debugEvent("FormalParameter"); | 266 debugEvent("FormalParameter"); |
| 267 assert(ignore); | 267 assert(ignore); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void endFormalParameters(int c, begin, end) { | 270 void endFormalParameters(int c, begin, end) { |
| 271 debugEvent("FormalParameters"); | 271 debugEvent("FormalParameters"); |
| 272 assert(ignore); | 272 assert(ignore); |
| 273 } | 273 } |
| 274 | 274 |
| 275 void endBlockFunctionBody(int count, Token begin, Token end) { | 275 void endBlockFunctionBody(int count, Token begin, Token end) { |
| 276 debugEvent("BlockFunctionBody"); | 276 debugEvent("BlockFunctionBody"); |
| 277 assert(ignore); | 277 assert(ignore); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void endFunctionDeclaration(token) { | 280 void endFunctionDeclaration(token) { |
| 281 debugEvent("FunctionDeclaration"); | 281 debugEvent("FunctionDeclaration"); |
| 282 _withinFunction--; | 282 _withinFunction--; |
| 283 if (ignore) return; | 283 if (ignore) return; |
| 284 _endFunction(); | 284 _endFunction(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void endFunctionName(Token token) { | 287 void endFunctionName(Token beginToken, Token token) { |
| 288 debugEvent("FunctionName"); | 288 debugEvent("FunctionName"); |
| 289 assert(ignore); | 289 assert(ignore); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void endLiteralMapEntry(colon, token) { | 292 void endLiteralMapEntry(colon, token) { |
| 293 debugEvent('MapEntry'); | 293 debugEvent('MapEntry'); |
| 294 if (ignore) return; | 294 if (ignore) return; |
| 295 var value = pop(); | 295 var value = pop(); |
| 296 var key = pop(); | 296 var key = pop(); |
| 297 push(new KeyValuePair(key, value)); | 297 push(new KeyValuePair(key, value)); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 void endTypeVariable(Token token, Token extendsOrSuper) { | 355 void endTypeVariable(Token token, Token extendsOrSuper) { |
| 356 debugEvent("endTypeVariable"); | 356 debugEvent("endTypeVariable"); |
| 357 assert(ignore); | 357 assert(ignore); |
| 358 } | 358 } |
| 359 | 359 |
| 360 void endTypeVariables(int count, Token beginToken, Token endToken) { | 360 void endTypeVariables(int count, Token beginToken, Token endToken) { |
| 361 debugEvent("TypeVariables"); | 361 debugEvent("TypeVariables"); |
| 362 assert(ignore); | 362 assert(ignore); |
| 363 } | 363 } |
| 364 | 364 |
| 365 void endUnnamedFunction(token) { | 365 void endUnnamedFunction(Token beginToken, Token token) { |
| 366 debugEvent("UnnamedFunction"); | 366 debugEvent("UnnamedFunction"); |
| 367 _withinFunction--; | 367 _withinFunction--; |
| 368 if (ignore) return; | 368 if (ignore) return; |
| 369 _endFunction(); | 369 _endFunction(); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void handleAsyncModifier(Token asyncToken, Token starToken) { | 372 void handleAsyncModifier(Token asyncToken, Token starToken) { |
| 373 debugEvent("AsyncModifier"); | 373 debugEvent("AsyncModifier"); |
| 374 assert(ignore); | 374 assert(ignore); |
| 375 } | 375 } |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 debugEvent("Fields"); | 995 debugEvent("Fields"); |
| 996 var s = scope; | 996 var s = scope; |
| 997 if (s is ClassScope) { | 997 if (s is ClassScope) { |
| 998 _endFields(count, s.currentClass.fields, false); | 998 _endFields(count, s.currentClass.fields, false); |
| 999 } else { | 999 } else { |
| 1000 throw new UnimplementedError(); // TODO(paulberry): does this ever occur? | 1000 throw new UnimplementedError(); // TODO(paulberry): does this ever occur? |
| 1001 // _endFields(count, s.currentEnum.values, false); | 1001 // _endFields(count, s.currentEnum.values, false); |
| 1002 } | 1002 } |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 void endFormalParameter( | 1005 void endFormalParameter(Token covariantKeyword, Token thisKeyword, |
| 1006 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { | 1006 Token nameToken, FormalParameterType kind) { |
| 1007 debugEvent("FormalParameter"); | 1007 debugEvent("FormalParameter"); |
| 1008 // TODO(sigmund): clean up? | 1008 // TODO(sigmund): clean up? |
| 1009 var nameOrFormal = pop(); | 1009 var nameOrFormal = pop(); |
| 1010 if (nameOrFormal is String) { | 1010 if (nameOrFormal is String) { |
| 1011 EntityRef type = pop(); | 1011 EntityRef type = pop(); |
| 1012 pop(); // Modifiers | 1012 pop(); // Modifiers |
| 1013 List metadata = pop(); | 1013 List metadata = pop(); |
| 1014 push(new UnlinkedParamBuilder( | 1014 push(new UnlinkedParamBuilder( |
| 1015 name: nameOrFormal, | 1015 name: nameOrFormal, |
| 1016 kind: _nextParamKind, | 1016 kind: _nextParamKind, |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 /// Internal representation of an initialized name. | 1552 /// Internal representation of an initialized name. |
| 1553 class _InitializedName { | 1553 class _InitializedName { |
| 1554 final String name; | 1554 final String name; |
| 1555 final UnlinkedExecutableBuilder initializer; | 1555 final UnlinkedExecutableBuilder initializer; |
| 1556 _InitializedName(this.name, this.initializer); | 1556 _InitializedName(this.name, this.initializer); |
| 1557 | 1557 |
| 1558 toString() => "II:" + (initializer != null ? "$name = $initializer" : name); | 1558 toString() => "II:" + (initializer != null ? "$name = $initializer" : name); |
| 1559 } | 1559 } |
| OLD | NEW |