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 ProcedureKind; | 7 import 'package:kernel/ast.dart' show ProcedureKind; |
8 | 8 |
9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; | 9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 class OutlineBuilder extends UnhandledListener { | 48 class OutlineBuilder extends UnhandledListener { |
49 final SourceLibraryBuilder library; | 49 final SourceLibraryBuilder library; |
50 | 50 |
51 final bool enableNative; | 51 final bool enableNative; |
52 | 52 |
53 String nativeMethodName; | 53 String nativeMethodName; |
54 | 54 |
55 OutlineBuilder(SourceLibraryBuilder library) | 55 OutlineBuilder(SourceLibraryBuilder library) |
56 : library = library, | 56 : library = library, |
57 enableNative = (library.uri.scheme == "dart" || library.isPatch); | 57 enableNative = library.loader.target.enableNative(library); |
58 | 58 |
59 @override | 59 @override |
60 Uri get uri => library.fileUri; | 60 Uri get uri => library.fileUri; |
61 | 61 |
62 @override | 62 @override |
63 int popCharOffset() => pop(); | 63 int popCharOffset() => pop(); |
64 | 64 |
65 List<String> popIdentifierList(int count) { | 65 List<String> popIdentifierList(int count) { |
66 if (count == 0) return null; | 66 if (count == 0) return null; |
67 List<String> list = new List<String>.filled(count, null, growable: true); | 67 List<String> list = new List<String>.filled(count, null, growable: true); |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 Link<Token> handleMemberName(Link<Token> identifiers) { | 797 Link<Token> handleMemberName(Link<Token> identifiers) { |
798 if (!enableNative || identifiers.isEmpty) return identifiers; | 798 if (!enableNative || identifiers.isEmpty) return identifiers; |
799 return removeNativeClause(identifiers); | 799 return removeNativeClause(identifiers); |
800 } | 800 } |
801 | 801 |
802 @override | 802 @override |
803 void debugEvent(String name) { | 803 void debugEvent(String name) { |
804 // printEvent(name); | 804 // printEvent(name); |
805 } | 805 } |
806 } | 806 } |
OLD | NEW |