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

Side by Side Diff: lib/enum_generator.dart

Issue 128003003: Fix issue with importing packages where the package name included a dot (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: Update pubspec version Created 6 years, 11 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
« no previous file with comments | « lib/code_generator.dart ('k') | lib/extension_generator.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 EnumAlias { 7 class EnumAlias {
8 final EnumValueDescriptorProto value; 8 final EnumValueDescriptorProto value;
9 final EnumValueDescriptorProto canonicalValue; 9 final EnumValueDescriptorProto canonicalValue;
10 EnumAlias(this.value, this.canonicalValue); 10 EnumAlias(this.value, this.canonicalValue);
11 } 11 }
12 12
13 class EnumGenerator implements ProtobufContainer { 13 class EnumGenerator extends ProtobufContainer {
14 final ProtobufContainer _parent; 14 final ProtobufContainer _parent;
15 final String classname; 15 final String classname;
16 final String fqname; 16 final String fqname;
17 final List<EnumValueDescriptorProto> _canonicalValues = 17 final List<EnumValueDescriptorProto> _canonicalValues =
18 <EnumValueDescriptorProto>[]; 18 <EnumValueDescriptorProto>[];
19 final List<EnumAlias> _aliases = <EnumAlias>[]; 19 final List<EnumAlias> _aliases = <EnumAlias>[];
20 20
21 EnumGenerator( 21 EnumGenerator(
22 EnumDescriptorProto descriptor, 22 EnumDescriptorProto descriptor,
23 ProtobufContainer parent, 23 ProtobufContainer parent,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 '${SP}ProtobufEnum.initByValue(values);'); 73 '${SP}ProtobufEnum.initByValue(values);');
74 out.println('static ${classname} valueOf(int value)${SP}=>' 74 out.println('static ${classname} valueOf(int value)${SP}=>'
75 '${SP}_byValue[value];'); 75 '${SP}_byValue[value];');
76 out.println(); 76 out.println();
77 77
78 out.println('const ${classname}._(int v,${SP}String n)${SP}' 78 out.println('const ${classname}._(int v,${SP}String n)${SP}'
79 ':${SP}super(v,${SP}n);'); 79 ':${SP}super(v,${SP}n);');
80 }); 80 });
81 } 81 }
82 } 82 }
OLDNEW
« no previous file with comments | « lib/code_generator.dart ('k') | lib/extension_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698