| OLD | NEW |
| 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.outline_builder; | 5 library fasta.outline_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; | 7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; |
| 8 | 8 |
| 9 import '../parser/parser.dart' show FormalParameterType, optional; | 9 import '../parser/parser.dart' show FormalParameterType, optional; |
| 10 | 10 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 library.addProcedure( | 254 library.addProcedure( |
| 255 metadata, | 255 metadata, |
| 256 modifiers, | 256 modifiers, |
| 257 returnType, | 257 returnType, |
| 258 name, | 258 name, |
| 259 typeVariables, | 259 typeVariables, |
| 260 formals, | 260 formals, |
| 261 asyncModifier, | 261 asyncModifier, |
| 262 computeProcedureKind(getOrSet), | 262 computeProcedureKind(getOrSet), |
| 263 beginToken.charOffset, | 263 beginToken.charOffset, |
| 264 endToken.charOffset, |
| 264 nativeMethodName, | 265 nativeMethodName, |
| 265 isTopLevel: true); | 266 isTopLevel: true); |
| 266 nativeMethodName = null; | 267 nativeMethodName = null; |
| 267 } | 268 } |
| 268 | 269 |
| 269 @override | 270 @override |
| 270 void handleNoFunctionBody(Token token) { | 271 void handleNoFunctionBody(Token token) { |
| 271 debugEvent("NoFunctionBody"); | 272 debugEvent("NoFunctionBody"); |
| 272 push(MethodBody.Abstract); | 273 push(MethodBody.Abstract); |
| 273 } | 274 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 304 name = operatorToString(nameOrOperator); | 305 name = operatorToString(nameOrOperator); |
| 305 kind = ProcedureKind.Operator; | 306 kind = ProcedureKind.Operator; |
| 306 } else { | 307 } else { |
| 307 name = nameOrOperator; | 308 name = nameOrOperator; |
| 308 kind = computeProcedureKind(getOrSet); | 309 kind = computeProcedureKind(getOrSet); |
| 309 } | 310 } |
| 310 TypeBuilder returnType = pop(); | 311 TypeBuilder returnType = pop(); |
| 311 int modifiers = | 312 int modifiers = |
| 312 Modifier.validate(pop(), isAbstract: bodyKind == MethodBody.Abstract); | 313 Modifier.validate(pop(), isAbstract: bodyKind == MethodBody.Abstract); |
| 313 List<MetadataBuilder> metadata = pop(); | 314 List<MetadataBuilder> metadata = pop(); |
| 314 library.addProcedure(metadata, modifiers, returnType, name, typeVariables, | 315 library.addProcedure( |
| 315 formals, asyncModifier, kind, beginToken.charOffset, nativeMethodName, | 316 metadata, |
| 317 modifiers, |
| 318 returnType, |
| 319 name, |
| 320 typeVariables, |
| 321 formals, |
| 322 asyncModifier, |
| 323 kind, |
| 324 beginToken.charOffset, |
| 325 endToken.charOffset, |
| 326 nativeMethodName, |
| 316 isTopLevel: false); | 327 isTopLevel: false); |
| 317 nativeMethodName = null; | 328 nativeMethodName = null; |
| 318 } | 329 } |
| 319 | 330 |
| 320 @override | 331 @override |
| 321 void endMixinApplication() { | 332 void endMixinApplication() { |
| 322 debugEvent("MixinApplication"); | 333 debugEvent("MixinApplication"); |
| 323 List<TypeBuilder> mixins = pop(); | 334 List<TypeBuilder> mixins = pop(); |
| 324 TypeBuilder supertype = pop(); | 335 TypeBuilder supertype = pop(); |
| 325 push(library.addMixinApplication(supertype, mixins, -1)); | 336 push(library.addMixinApplication(supertype, mixins, -1)); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 formals = new List<FormalParameterBuilder>.from(formals); | 476 formals = new List<FormalParameterBuilder>.from(formals); |
| 466 } | 477 } |
| 467 push(formals ?? NullValue.FormalParameters); | 478 push(formals ?? NullValue.FormalParameters); |
| 468 } | 479 } |
| 469 | 480 |
| 470 @override | 481 @override |
| 471 void endEnum(Token enumKeyword, Token endBrace, int count) { | 482 void endEnum(Token enumKeyword, Token endBrace, int count) { |
| 472 List<String> constants = popList(count); | 483 List<String> constants = popList(count); |
| 473 String name = pop(); | 484 String name = pop(); |
| 474 List<MetadataBuilder> metadata = pop(); | 485 List<MetadataBuilder> metadata = pop(); |
| 475 library.addEnum(metadata, name, constants, enumKeyword.charOffset); | 486 library.addEnum( |
| 487 metadata, name, constants, enumKeyword.charOffset, endBrace.charOffset); |
| 476 checkEmpty(enumKeyword.charOffset); | 488 checkEmpty(enumKeyword.charOffset); |
| 477 } | 489 } |
| 478 | 490 |
| 479 @override | 491 @override |
| 480 void beginFunctionTypeAlias(Token token) { | 492 void beginFunctionTypeAlias(Token token) { |
| 481 library.beginNestedDeclaration(null, hasMembers: false); | 493 library.beginNestedDeclaration(null, hasMembers: false); |
| 482 } | 494 } |
| 483 | 495 |
| 484 @override | 496 @override |
| 485 void endFunctionTypeAlias( | 497 void endFunctionTypeAlias( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 MethodBody kind = pop(); | 567 MethodBody kind = pop(); |
| 556 ConstructorReferenceBuilder redirectionTarget; | 568 ConstructorReferenceBuilder redirectionTarget; |
| 557 if (kind == MethodBody.RedirectingFactoryBody) { | 569 if (kind == MethodBody.RedirectingFactoryBody) { |
| 558 redirectionTarget = pop(); | 570 redirectionTarget = pop(); |
| 559 } | 571 } |
| 560 AsyncMarker asyncModifier = pop(); | 572 AsyncMarker asyncModifier = pop(); |
| 561 List<FormalParameterBuilder> formals = pop(); | 573 List<FormalParameterBuilder> formals = pop(); |
| 562 var name = pop(); | 574 var name = pop(); |
| 563 int modifiers = Modifier.validate(pop()); | 575 int modifiers = Modifier.validate(pop()); |
| 564 List<MetadataBuilder> metadata = pop(); | 576 List<MetadataBuilder> metadata = pop(); |
| 565 library.addFactoryMethod(metadata, modifiers, name, formals, asyncModifier, | 577 library.addFactoryMethod( |
| 566 redirectionTarget, beginToken.charOffset, nativeMethodName); | 578 metadata, |
| 579 modifiers, |
| 580 name, |
| 581 formals, |
| 582 asyncModifier, |
| 583 redirectionTarget, |
| 584 beginToken.charOffset, |
| 585 endToken.charOffset, |
| 586 nativeMethodName); |
| 567 nativeMethodName = null; | 587 nativeMethodName = null; |
| 568 } | 588 } |
| 569 | 589 |
| 570 @override | 590 @override |
| 571 void endRedirectingFactoryBody(Token beginToken, Token endToken) { | 591 void endRedirectingFactoryBody(Token beginToken, Token endToken) { |
| 572 debugEvent("RedirectingFactoryBody"); | 592 debugEvent("RedirectingFactoryBody"); |
| 573 push(MethodBody.RedirectingFactoryBody); | 593 push(MethodBody.RedirectingFactoryBody); |
| 574 } | 594 } |
| 575 | 595 |
| 576 @override | 596 @override |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 Link<Token> handleMemberName(Link<Token> identifiers) { | 661 Link<Token> handleMemberName(Link<Token> identifiers) { |
| 642 if (!isDartLibrary || identifiers.isEmpty) return identifiers; | 662 if (!isDartLibrary || identifiers.isEmpty) return identifiers; |
| 643 return removeNativeClause(identifiers); | 663 return removeNativeClause(identifiers); |
| 644 } | 664 } |
| 645 | 665 |
| 646 @override | 666 @override |
| 647 void debugEvent(String name) { | 667 void debugEvent(String name) { |
| 648 // printEvent(name); | 668 // printEvent(name); |
| 649 } | 669 } |
| 650 } | 670 } |
| OLD | NEW |