Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: pkg/compiler/lib/src/serialization/serialization.dart

Issue 2837473002: merge fasta.PrecedenceInfo into analyzer.TokenType (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.serialization; 5 library dart2js.serialization;
6 6
7 import 'package:front_end/src/fasta/scanner/precedence.dart' 7 import 'package:front_end/src/scanner/token.dart' show TokenType;
8 show PrecedenceInfo;
9 8
10 import '../common.dart'; 9 import '../common.dart';
11 import '../common/resolution.dart'; 10 import '../common/resolution.dart';
12 import '../constants/expressions.dart'; 11 import '../constants/expressions.dart';
13 import '../elements/resolution_types.dart'; 12 import '../elements/resolution_types.dart';
14 import '../elements/elements.dart'; 13 import '../elements/elements.dart';
15 import '../library_loader.dart' show LibraryProvider; 14 import '../library_loader.dart' show LibraryProvider;
16 import '../util/enumset.dart'; 15 import '../util/enumset.dart';
17 import 'constant_serialization.dart'; 16 import 'constant_serialization.dart';
18 import 'element_serialization.dart'; 17 import 'element_serialization.dart';
19 import 'json_serializer.dart'; 18 import 'json_serializer.dart';
20 import 'keys.dart'; 19 import 'keys.dart';
21 import 'type_serialization.dart'; 20 import 'type_serialization.dart';
22 import 'values.dart'; 21 import 'values.dart';
23 22
24 export 'task.dart' show LibraryDeserializer; 23 export 'task.dart' show LibraryDeserializer;
25 24
26 final Map<String, String> canonicalNames = computeCanonicalNames(); 25 final Map<String, String> canonicalNames = computeCanonicalNames();
27 26
28 Map<String, String> computeCanonicalNames() { 27 Map<String, String> computeCanonicalNames() {
29 Map<String, String> result = <String, String>{}; 28 Map<String, String> result = <String, String>{};
30 for (PrecedenceInfo info in PrecedenceInfo.all) { 29 for (TokenType info in TokenType.all) {
31 result[info.value] = info.value; 30 result[info.value] = info.value;
32 } 31 }
33 return result; 32 return result;
34 } 33 }
35 34
36 /// An object that supports the encoding an [ObjectValue] for serialization. 35 /// An object that supports the encoding an [ObjectValue] for serialization.
37 /// 36 ///
38 /// The [ObjectEncoder] ensures that nominality and circularities of 37 /// The [ObjectEncoder] ensures that nominality and circularities of
39 /// non-primitive values like [Element], [ResolutionDartType] and 38 /// non-primitive values like [Element], [ResolutionDartType] and
40 /// [ConstantExpression] are handled. 39 /// [ConstantExpression] are handled.
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 1151
1153 /// Returns the value used to store [key] as a property in the encoding an 1152 /// Returns the value used to store [key] as a property in the encoding an
1154 /// [ObjectValue]. 1153 /// [ObjectValue].
1155 /// 1154 ///
1156 /// Different encodings have different restrictions and capabilities as how 1155 /// Different encodings have different restrictions and capabilities as how
1157 /// to store a [Key] value. For instance: A JSON encoding needs to convert 1156 /// to store a [Key] value. For instance: A JSON encoding needs to convert
1158 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can 1157 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can
1159 /// choose to store a [Key] as an [int] or as the [Key] itself. 1158 /// choose to store a [Key] as an [int] or as the [Key] itself.
1160 getObjectPropertyValue(Key key); 1159 getObjectPropertyValue(Key key);
1161 } 1160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698