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

Side by Side Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 647563002: Test that analysis server and analysis engine enums properly match. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
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 library protocol; 5 library protocol;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 part 'generated_protocol.dart'; 10 part 'generated_protocol.dart';
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return new MoveFileOptions.fromJson(jsonDecoder, jsonPath, json); 219 return new MoveFileOptions.fromJson(jsonDecoder, jsonPath, json);
220 } 220 }
221 if (kind == RefactoringKind.RENAME) { 221 if (kind == RefactoringKind.RENAME) {
222 return new RenameOptions.fromJson(jsonDecoder, jsonPath, json); 222 return new RenameOptions.fromJson(jsonDecoder, jsonPath, json);
223 } 223 }
224 return null; 224 return null;
225 } 225 }
226 226
227 227
228 /** 228 /**
229 * Classes implementing [Enum] represent enumerated types in the protocol.
230 */
231 abstract class Enum {
Brian Wilkerson 2014/10/09 21:41:22 I can't think of a better name, but I am mildly co
232 /**
233 * The name of the enumerated value. This should match the name of the
234 * static getter which provides access to this enumerated value.
235 */
236 String get name;
237 }
238
239
240 /**
229 * Type of callbacks used to decode parts of JSON objects. [jsonPath] is a 241 * Type of callbacks used to decode parts of JSON objects. [jsonPath] is a
230 * string describing the part of the JSON object being decoded, and [value] is 242 * string describing the part of the JSON object being decoded, and [value] is
231 * the part to decode. 243 * the part to decode.
232 */ 244 */
233 typedef Object JsonDecoderCallback(String jsonPath, Object value); 245 typedef Object JsonDecoderCallback(String jsonPath, Object value);
234 246
235 247
236 /** 248 /**
237 * Instances of the class [HasToJson] implement [toJson] method that returns 249 * Instances of the class [HasToJson] implement [toJson] method that returns
238 * a JSON presentation. 250 * a JSON presentation.
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 846 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
835 hash = hash ^ (hash >> 11); 847 hash = hash ^ (hash >> 11);
836 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 848 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
837 } 849 }
838 850
839 static int hash2(a, b) => finish(combine(combine(0, a), b)); 851 static int hash2(a, b) => finish(combine(combine(0, a), b));
840 852
841 static int hash4(a, b, c, d) => 853 static int hash4(a, b, c, d) =>
842 finish(combine(combine(combine(combine(0, a), b), c), d)); 854 finish(combine(combine(combine(combine(0, a), b), c), d));
843 } 855 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698