OLD | NEW |
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 /** | 5 /** |
6 * This file contains code to generate serialization/deserialization logic for | 6 * This file contains code to generate serialization/deserialization logic for |
7 * summaries based on an "IDL" description of the summary format (written in | 7 * summaries based on an "IDL" description of the summary format (written in |
8 * stylized Dart). | 8 * stylized Dart). |
9 * | 9 * |
10 * For each class in the "IDL" input, two corresponding classes are generated: | 10 * For each class in the "IDL" input, two corresponding classes are generated: |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 throw new Exception('$name: file identifier must be 4 characters'); | 112 throw new Exception('$name: file identifier must be 4 characters'); |
113 } | 113 } |
114 for (int i = 0; i < cls.fileIdentifier.length; i++) { | 114 for (int i = 0; i < cls.fileIdentifier.length; i++) { |
115 if (cls.fileIdentifier.codeUnitAt(i) >= 256) { | 115 if (cls.fileIdentifier.codeUnitAt(i) >= 256) { |
116 throw new Exception( | 116 throw new Exception( |
117 '$name: file identifier must be encodable as Latin-1'); | 117 '$name: file identifier must be encodable as Latin-1'); |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 Map<int, String> idsUsed = <int, String>{}; | 121 Map<int, String> idsUsed = <int, String>{}; |
122 for (idlModel.FieldDeclaration field in cls.allFields) { | 122 for (idlModel.FieldDeclaration field in cls.fields) { |
123 String fieldName = field.name; | 123 String fieldName = field.name; |
124 idlModel.FieldType type = field.type; | 124 idlModel.FieldType type = field.type; |
125 if (type.isList) { | 125 if (type.isList) { |
126 if (_idl.classes.containsKey(type.typeName)) { | 126 if (_idl.classes.containsKey(type.typeName)) { |
127 // List of classes is ok | 127 // List of classes is ok |
128 } else if (_idl.enums.containsKey(type.typeName)) { | 128 } else if (_idl.enums.containsKey(type.typeName)) { |
129 // List of enums is ok | 129 // List of enums is ok |
130 } else if (type.typeName == 'bool') { | 130 } else if (type.typeName == 'bool') { |
131 // List of booleans is ok | 131 // List of booleans is ok |
132 } else if (type.typeName == 'int') { | 132 } else if (type.typeName == 'int') { |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 return token.lexeme.split('\n').map((String line) { | 1023 return token.lexeme.split('\n').map((String line) { |
1024 if (line.startsWith(indent)) { | 1024 if (line.startsWith(indent)) { |
1025 line = line.substring(indent.length); | 1025 line = line.substring(indent.length); |
1026 } | 1026 } |
1027 return line; | 1027 return line; |
1028 }).join('\n'); | 1028 }).join('\n'); |
1029 } | 1029 } |
1030 return null; | 1030 return null; |
1031 } | 1031 } |
1032 } | 1032 } |
OLD | NEW |