OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
6 | 6 |
7 import 'package:analyzer/src/codegen/tools.dart'; | 7 import 'package:analyzer/src/codegen/tools.dart'; |
8 import 'package:front_end/src/codegen/tools.dart'; | 8 import 'package:front_end/src/codegen/tools.dart'; |
9 import 'package:html/dom.dart' as dom; | 9 import 'package:html/dom.dart' as dom; |
10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
(...skipping 12 matching lines...) Expand all Loading... |
23 'abstract': '0x01', | 23 'abstract': '0x01', |
24 'const': '0x02', | 24 'const': '0x02', |
25 'final': '0x04', | 25 'final': '0x04', |
26 'static': '0x08', | 26 'static': '0x08', |
27 'private': '0x10', | 27 'private': '0x10', |
28 'deprecated': '0x20' | 28 'deprecated': '0x20' |
29 }; | 29 }; |
30 | 30 |
31 GeneratedFile target(bool responseRequiresRequestTime) { | 31 GeneratedFile target(bool responseRequiresRequestTime) { |
32 return new GeneratedFile('lib/protocol/protocol_generated.dart', | 32 return new GeneratedFile('lib/protocol/protocol_generated.dart', |
33 (String pkgPath) { | 33 (String pkgPath) async { |
34 CodegenProtocolVisitor visitor = new CodegenProtocolVisitor( | 34 CodegenProtocolVisitor visitor = new CodegenProtocolVisitor( |
35 path.basename(pkgPath), responseRequiresRequestTime, readApi(pkgPath)); | 35 path.basename(pkgPath), responseRequiresRequestTime, readApi(pkgPath)); |
36 return visitor.collectCode(visitor.visitApi); | 36 return visitor.collectCode(visitor.visitApi); |
37 }); | 37 }); |
38 } | 38 } |
39 | 39 |
40 /** | 40 /** |
41 * Callback type used to represent arbitrary code generation. | 41 * Callback type used to represent arbitrary code generation. |
42 */ | 42 */ |
43 typedef void CodegenCallback(); | 43 typedef void CodegenCallback(); |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 | 1317 |
1318 @override | 1318 @override |
1319 String get asClosure => '($type value) => ${callback('value')}'; | 1319 String get asClosure => '($type value) => ${callback('value')}'; |
1320 | 1320 |
1321 @override | 1321 @override |
1322 bool get isIdentity => false; | 1322 bool get isIdentity => false; |
1323 | 1323 |
1324 @override | 1324 @override |
1325 String asSnippet(String value) => callback(value); | 1325 String asSnippet(String value) => callback(value); |
1326 } | 1326 } |
OLD | NEW |