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/dart2js_native.dart' show skipDart2jsNativeClause; |
| 32 |
31 import '../parser/dart_vm_native.dart' | 33 import '../parser/dart_vm_native.dart' |
32 show removeNativeClause, skipNativeClause; | 34 show removeNativeClause, skipVmNativeClause; |
33 | 35 |
34 import '../operator.dart' | 36 import '../operator.dart' |
35 show | 37 show |
36 Operator, | 38 Operator, |
37 operatorFromString, | 39 operatorFromString, |
38 operatorToString, | 40 operatorToString, |
39 operatorRequiredArgumentCount; | 41 operatorRequiredArgumentCount; |
40 | 42 |
41 import '../quote.dart' show unescapeString; | 43 import '../quote.dart' show unescapeString; |
42 | 44 |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 803 |
802 @override | 804 @override |
803 void handleModifiers(int count) { | 805 void handleModifiers(int count) { |
804 debugEvent("Modifiers"); | 806 debugEvent("Modifiers"); |
805 push(popList(count) ?? NullValue.Modifiers); | 807 push(popList(count) ?? NullValue.Modifiers); |
806 } | 808 } |
807 | 809 |
808 @override | 810 @override |
809 Token handleUnrecoverableError(Token token, FastaMessage message) { | 811 Token handleUnrecoverableError(Token token, FastaMessage message) { |
810 if (isDartLibrary && message.code == codeExpectedBlockToSkip) { | 812 if (isDartLibrary && message.code == codeExpectedBlockToSkip) { |
811 Token recover = skipNativeClause(token); | 813 if (library.loader.target.forDart2js) { |
812 if (recover != null) { | 814 Token recover = skipDart2jsNativeClause(token); |
813 nativeMethodName = unescapeString(token.next.lexeme); | 815 if (recover != null) return recover; |
814 return recover; | 816 } else if (library.loader.target.forVm) { |
| 817 Token recover = skipVmNativeClause(token); |
| 818 if (recover != null) { |
| 819 nativeMethodName = unescapeString(token.next.lexeme); |
| 820 return recover; |
| 821 } |
815 } | 822 } |
816 } | 823 } |
817 return super.handleUnrecoverableError(token, message); | 824 return super.handleUnrecoverableError(token, message); |
818 } | 825 } |
819 | 826 |
820 @override | 827 @override |
821 Link<Token> handleMemberName(Link<Token> identifiers) { | 828 Link<Token> handleMemberName(Link<Token> identifiers) { |
822 if (!isDartLibrary || identifiers.isEmpty) return identifiers; | 829 if (!isDartLibrary || identifiers.isEmpty) return identifiers; |
823 return removeNativeClause(identifiers); | 830 return removeNativeClause(identifiers); |
824 } | 831 } |
825 | 832 |
826 @override | 833 @override |
827 void debugEvent(String name) { | 834 void debugEvent(String name) { |
828 // printEvent(name); | 835 // printEvent(name); |
829 } | 836 } |
830 } | 837 } |
OLD | NEW |