| 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 '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; | 9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 import '../errors.dart' show internalError; | 21 import '../errors.dart' show internalError; |
| 22 | 22 |
| 23 import '../builder/builder.dart'; | 23 import '../builder/builder.dart'; |
| 24 | 24 |
| 25 import '../modifier.dart' show Modifier; | 25 import '../modifier.dart' show Modifier; |
| 26 | 26 |
| 27 import 'source_library_builder.dart' show SourceLibraryBuilder; | 27 import 'source_library_builder.dart' show SourceLibraryBuilder; |
| 28 | 28 |
| 29 import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener; | 29 import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener; |
| 30 | 30 |
| 31 import '../parser/dart_vm_native.dart' | 31 import '../parser/dart_vm_native.dart' show removeNativeClause; |
| 32 show removeNativeClause, skipNativeClause; | |
| 33 | 32 |
| 34 import '../operator.dart' | 33 import '../operator.dart' |
| 35 show | 34 show |
| 36 Operator, | 35 Operator, |
| 37 operatorFromString, | 36 operatorFromString, |
| 38 operatorToString, | 37 operatorToString, |
| 39 operatorRequiredArgumentCount; | 38 operatorRequiredArgumentCount; |
| 40 | 39 |
| 41 import '../quote.dart' show unescapeString; | 40 import '../quote.dart' show unescapeString; |
| 42 | 41 |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 | 800 |
| 802 @override | 801 @override |
| 803 void handleModifiers(int count) { | 802 void handleModifiers(int count) { |
| 804 debugEvent("Modifiers"); | 803 debugEvent("Modifiers"); |
| 805 push(popList(count) ?? NullValue.Modifiers); | 804 push(popList(count) ?? NullValue.Modifiers); |
| 806 } | 805 } |
| 807 | 806 |
| 808 @override | 807 @override |
| 809 Token handleUnrecoverableError(Token token, FastaMessage message) { | 808 Token handleUnrecoverableError(Token token, FastaMessage message) { |
| 810 if (isDartLibrary && message.code == codeExpectedBlockToSkip) { | 809 if (isDartLibrary && message.code == codeExpectedBlockToSkip) { |
| 811 Token recover = skipNativeClause(token); | 810 var target = library.loader.target; |
| 811 Token recover = target.skipNativeClause(token); |
| 812 if (recover != null) { | 812 if (recover != null) { |
| 813 nativeMethodName = unescapeString(token.next.lexeme); | 813 nativeMethodName = target.extractNativeMethodName(token); |
| 814 return recover; | 814 return recover; |
| 815 } | 815 } |
| 816 } | 816 } |
| 817 return super.handleUnrecoverableError(token, message); | 817 return super.handleUnrecoverableError(token, message); |
| 818 } | 818 } |
| 819 | 819 |
| 820 @override | 820 @override |
| 821 Link<Token> handleMemberName(Link<Token> identifiers) { | 821 Link<Token> handleMemberName(Link<Token> identifiers) { |
| 822 if (!isDartLibrary || identifiers.isEmpty) return identifiers; | 822 if (!isDartLibrary || identifiers.isEmpty) return identifiers; |
| 823 return removeNativeClause(identifiers); | 823 return removeNativeClause(identifiers); |
| 824 } | 824 } |
| 825 | 825 |
| 826 @override | 826 @override |
| 827 void debugEvent(String name) { | 827 void debugEvent(String name) { |
| 828 // printEvent(name); | 828 // printEvent(name); |
| 829 } | 829 } |
| 830 } | 830 } |
| OLD | NEW |