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

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

Issue 3003263002: add support for native methods in class
Patch Set: update listeners Created 3 years, 3 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.diet_listener; 5 library fasta.diet_listener;
6 6
7 import 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
8 show AsyncMarker, Class, InterfaceType, Typedef; 8 show AsyncMarker, Class, InterfaceType, Typedef;
9 import 'package:kernel/ast.dart'; 9 import 'package:kernel/ast.dart';
10 10
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 MemberKind.Factory, metadata); 401 MemberKind.Factory, metadata);
402 } 402 }
403 403
404 @override 404 @override
405 void endRedirectingFactoryBody(Token beginToken, Token endToken) { 405 void endRedirectingFactoryBody(Token beginToken, Token endToken) {
406 debugEvent("RedirectingFactoryBody"); 406 debugEvent("RedirectingFactoryBody");
407 discard(1); // ConstructorReference. 407 discard(1); // ConstructorReference.
408 } 408 }
409 409
410 @override 410 @override
411 void endMethod(Token getOrSet, Token beginToken, Token endToken) { 411 void endMethod(
412 Token getOrSet, Token beginToken, Token nativeToken, Token endToken) {
412 debugEvent("Method"); 413 debugEvent("Method");
413 Token bodyToken = pop(); 414 Token bodyToken = pop();
414 String name = pop(); 415 String name = pop();
415 Token metadata = pop(); 416 Token metadata = pop();
416 checkEmpty(beginToken.charOffset); 417 checkEmpty(beginToken.charOffset);
417 if (bodyToken == null) { 418 if (bodyToken == null) {
418 // TODO(ahe): Don't skip this. We need to compile metadata. 419 // TODO(ahe): Don't skip this. We need to compile metadata.
419 return; 420 return;
420 } 421 }
421 ProcedureBuilder builder = lookupBuilder(beginToken, getOrSet, name); 422 ProcedureBuilder builder = lookupBuilder(beginToken, getOrSet, name);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 void addAnnotation(Expression annotation)) { 673 void addAnnotation(Expression annotation)) {
673 if (metadata != null) { 674 if (metadata != null) {
674 var listener = createListener(builder, memberScope, false); 675 var listener = createListener(builder, memberScope, false);
675 var parser = new Parser(listener); 676 var parser = new Parser(listener);
676 parser.parseMetadataStar(metadata); 677 parser.parseMetadataStar(metadata);
677 List<Expression> metadataConstants = listener.finishMetadata(); 678 List<Expression> metadataConstants = listener.finishMetadata();
678 metadataConstants.forEach(addAnnotation); 679 metadataConstants.forEach(addAnnotation);
679 } 680 }
680 } 681 }
681 } 682 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698