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

Side by Side Diff: lib/protobuf_field.dart

Issue 25708003: Update the protocol buffer compiler plugin to use Int64 from the fixnum package (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of protoc; 5 part of protoc;
6 6
7 class ProtobufField { 7 class ProtobufField {
8 static final RegExp HEX_LITERAL_REGEX = 8 static final RegExp HEX_LITERAL_REGEX =
9 new RegExp(r'^0x[0-9a-f]+$', multiLine: false, caseSensitive: false); 9 new RegExp(r'^0x[0-9a-f]+$', multiLine: false, caseSensitive: false);
10 static final RegExp INTEGER_LITERAL_REGEX = new RegExp(r'^[+-]?[0-9]+$'); 10 static final RegExp INTEGER_LITERAL_REGEX = new RegExp(r'^[+-]?[0-9]+$');
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 if (field.hasDefaultValue() && '0' != field.defaultValue) { 187 if (field.hasDefaultValue() && '0' != field.defaultValue) {
188 initialization = '()${SP}=>${SP}${field.defaultValue}'; 188 initialization = '()${SP}=>${SP}${field.defaultValue}';
189 } 189 }
190 } 190 }
191 break; 191 break;
192 case FieldDescriptorProto_Type.TYPE_INT64: 192 case FieldDescriptorProto_Type.TYPE_INT64:
193 case FieldDescriptorProto_Type.TYPE_UINT64: 193 case FieldDescriptorProto_Type.TYPE_UINT64:
194 case FieldDescriptorProto_Type.TYPE_SINT64: 194 case FieldDescriptorProto_Type.TYPE_SINT64:
195 case FieldDescriptorProto_Type.TYPE_FIXED64: 195 case FieldDescriptorProto_Type.TYPE_FIXED64:
196 case FieldDescriptorProto_Type.TYPE_SFIXED64: 196 case FieldDescriptorProto_Type.TYPE_SFIXED64:
197 baseType = 'ByteData'; 197 baseType = 'Int64';
198 typeString = write('ByteData'); 198 typeString = write('Int64');
199 packable = true; 199 packable = true;
200 switch (field.type) { 200 switch (field.type) {
201 case FieldDescriptorProto_Type.TYPE_INT64: 201 case FieldDescriptorProto_Type.TYPE_INT64:
202 codedStreamType = 'Int64'; 202 codedStreamType = 'Int64';
203 break; 203 break;
204 case FieldDescriptorProto_Type.TYPE_UINT64: 204 case FieldDescriptorProto_Type.TYPE_UINT64:
205 codedStreamType = 'Uint64'; 205 codedStreamType = 'Uint64';
206 break; 206 break;
207 case FieldDescriptorProto_Type.TYPE_SINT64: 207 case FieldDescriptorProto_Type.TYPE_SINT64:
208 codedStreamType = 'Sint64'; 208 codedStreamType = 'Sint64';
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return 2; // Length-delimited 348 return 2; // Length-delimited
349 case FieldDescriptorProto_Type.TYPE_GROUP: 349 case FieldDescriptorProto_Type.TYPE_GROUP:
350 return 3; // Start group 350 return 3; // Start group
351 case FieldDescriptorProto_Type.TYPE_FLOAT: 351 case FieldDescriptorProto_Type.TYPE_FLOAT:
352 case FieldDescriptorProto_Type.TYPE_FIXED32: 352 case FieldDescriptorProto_Type.TYPE_FIXED32:
353 case FieldDescriptorProto_Type.TYPE_SFIXED32: 353 case FieldDescriptorProto_Type.TYPE_SFIXED32:
354 return 5; // 32-bit 354 return 5; // 32-bit
355 } 355 }
356 } 356 }
357 } 357 }
OLDNEW
« no previous file with comments | « lib/file_generator.dart ('k') | prepend.dart » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698