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.diet_listener; | 5 library fasta.diet_listener; |
6 | 6 |
7 import 'package:kernel/ast.dart' show AsyncMarker; | 7 import 'package:kernel/ast.dart' show AsyncMarker; |
8 | 8 |
9 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; | 9 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
10 | 10 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 void parseFunctionBody(StackListener listener, Token token) { | 489 void parseFunctionBody(StackListener listener, Token token) { |
490 try { | 490 try { |
491 Parser parser = new Parser(listener); | 491 Parser parser = new Parser(listener); |
492 token = parser.parseFormalParametersOpt(token); | 492 token = parser.parseFormalParametersOpt(token); |
493 var formals = listener.pop(); | 493 var formals = listener.pop(); |
494 listener.checkEmpty(token.charOffset); | 494 listener.checkEmpty(token.charOffset); |
495 listener.prepareInitializers(); | 495 listener.prepareInitializers(); |
496 token = parser.parseInitializersOpt(token); | 496 token = parser.parseInitializersOpt(token); |
497 token = parser.parseAsyncModifier(token); | 497 token = parser.parseAsyncModifier(token); |
498 AsyncMarker asyncModifier = listener.pop(); | 498 AsyncMarker asyncModifier = |
| 499 astKind == AstKind.Analyzer ? null : listener.pop(); |
499 bool isExpression = false; | 500 bool isExpression = false; |
500 bool allowAbstract = true; | 501 bool allowAbstract = true; |
501 parser.parseFunctionBody(token, isExpression, allowAbstract); | 502 parser.parseFunctionBody(token, isExpression, allowAbstract); |
502 var body = listener.pop(); | 503 var body = listener.pop(); |
503 listener.checkEmpty(token.charOffset); | 504 listener.checkEmpty(token.charOffset); |
504 listener.finishFunction(formals, asyncModifier, body); | 505 listener.finishFunction(formals, asyncModifier, body); |
505 } on InputError { | 506 } on InputError { |
506 rethrow; | 507 rethrow; |
507 } catch (e, s) { | 508 } catch (e, s) { |
508 throw new Crash(uri, token.charOffset, e, s); | 509 throw new Crash(uri, token.charOffset, e, s); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 bool get isTargetingDartVm { | 559 bool get isTargetingDartVm { |
559 // TODO(ahe): Find a more reliable way to check if this is the Dart VM. | 560 // TODO(ahe): Find a more reliable way to check if this is the Dart VM. |
560 return !coreTypes.containsLibrary("dart:_js_helper"); | 561 return !coreTypes.containsLibrary("dart:_js_helper"); |
561 } | 562 } |
562 | 563 |
563 @override | 564 @override |
564 void debugEvent(String name) { | 565 void debugEvent(String name) { |
565 // printEvent(name); | 566 // printEvent(name); |
566 } | 567 } |
567 } | 568 } |
OLD | NEW |