Chromium Code Reviews| 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 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". | 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| 7 | 7 |
| 8 library analyzer.src.summary.format; | 8 library analyzer.src.summary.format; |
| 9 | 9 |
| 10 import 'dart:convert'; | 10 import 'dart:convert'; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 PrelinkedDependency.fromJson(Map json) | 36 PrelinkedDependency.fromJson(Map json) |
| 37 : _uri = json["uri"]; | 37 : _uri = json["uri"]; |
| 38 | 38 |
| 39 String get uri => _uri ?? ''; | 39 String get uri => _uri ?? ''; |
| 40 } | 40 } |
| 41 | 41 |
| 42 class PrelinkedDependencyBuilder { | 42 class PrelinkedDependencyBuilder { |
| 43 final Map _json = {}; | 43 final Map _json = {}; |
| 44 | 44 |
| 45 bool _finished = false; | |
|
Brian Wilkerson
2015/12/14 16:54:01
Might be cleaner to reverse the sense of these fie
| |
| 46 | |
| 45 PrelinkedDependencyBuilder(builder.BuilderContext context); | 47 PrelinkedDependencyBuilder(builder.BuilderContext context); |
| 46 | 48 |
| 47 void set uri(String _value) { | 49 void set uri(String _value) { |
| 50 assert(!_finished); | |
| 48 assert(!_json.containsKey("uri")); | 51 assert(!_json.containsKey("uri")); |
| 49 if (_value != null) { | 52 if (_value != null) { |
| 50 _json["uri"] = _value; | 53 _json["uri"] = _value; |
| 51 } | 54 } |
| 52 } | 55 } |
| 53 | 56 |
| 54 Map finish() => _json; | 57 Map finish() { |
| 58 assert(!_finished); | |
| 59 _finished = true; | |
| 60 return _json; | |
| 61 } | |
| 55 } | 62 } |
| 56 | 63 |
| 57 PrelinkedDependencyBuilder encodePrelinkedDependency(builder.BuilderContext buil derContext, {String uri}) { | 64 PrelinkedDependencyBuilder encodePrelinkedDependency(builder.BuilderContext buil derContext, {String uri}) { |
| 58 PrelinkedDependencyBuilder builder = new PrelinkedDependencyBuilder(builderCon text); | 65 PrelinkedDependencyBuilder builder = new PrelinkedDependencyBuilder(builderCon text); |
| 59 builder.uri = uri; | 66 builder.uri = uri; |
| 60 return builder; | 67 return builder; |
| 61 } | 68 } |
| 62 | 69 |
| 63 class PrelinkedLibrary { | 70 class PrelinkedLibrary { |
| 64 UnlinkedLibrary _unlinked; | 71 UnlinkedLibrary _unlinked; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 76 | 83 |
| 77 UnlinkedLibrary get unlinked => _unlinked; | 84 UnlinkedLibrary get unlinked => _unlinked; |
| 78 List<PrelinkedDependency> get dependencies => _dependencies ?? const <Prelinke dDependency>[]; | 85 List<PrelinkedDependency> get dependencies => _dependencies ?? const <Prelinke dDependency>[]; |
| 79 List<int> get importDependencies => _importDependencies ?? const <int>[]; | 86 List<int> get importDependencies => _importDependencies ?? const <int>[]; |
| 80 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[]; | 87 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[]; |
| 81 } | 88 } |
| 82 | 89 |
| 83 class PrelinkedLibraryBuilder { | 90 class PrelinkedLibraryBuilder { |
| 84 final Map _json = {}; | 91 final Map _json = {}; |
| 85 | 92 |
| 93 bool _finished = false; | |
| 94 | |
| 86 PrelinkedLibraryBuilder(builder.BuilderContext context); | 95 PrelinkedLibraryBuilder(builder.BuilderContext context); |
| 87 | 96 |
| 88 void set unlinked(UnlinkedLibraryBuilder _value) { | 97 void set unlinked(UnlinkedLibraryBuilder _value) { |
| 98 assert(!_finished); | |
| 89 assert(!_json.containsKey("unlinked")); | 99 assert(!_json.containsKey("unlinked")); |
| 90 if (_value != null) { | 100 if (_value != null) { |
| 91 _json["unlinked"] = _value.finish(); | 101 _json["unlinked"] = _value.finish(); |
| 92 } | 102 } |
| 93 } | 103 } |
| 94 | 104 |
| 95 void set dependencies(List<PrelinkedDependencyBuilder> _value) { | 105 void set dependencies(List<PrelinkedDependencyBuilder> _value) { |
| 106 assert(!_finished); | |
| 96 assert(!_json.containsKey("dependencies")); | 107 assert(!_json.containsKey("dependencies")); |
| 97 if (_value != null || _value.isEmpty) { | 108 if (_value != null || _value.isEmpty) { |
| 98 _json["dependencies"] = _value.map((b) => b.finish()).toList(); | 109 _json["dependencies"] = _value.map((b) => b.finish()).toList(); |
| 99 } | 110 } |
| 100 } | 111 } |
| 101 | 112 |
| 102 void set importDependencies(List<int> _value) { | 113 void set importDependencies(List<int> _value) { |
| 114 assert(!_finished); | |
| 103 assert(!_json.containsKey("importDependencies")); | 115 assert(!_json.containsKey("importDependencies")); |
| 104 if (_value != null || _value.isEmpty) { | 116 if (_value != null || _value.isEmpty) { |
| 105 _json["importDependencies"] = _value.toList(); | 117 _json["importDependencies"] = _value.toList(); |
| 106 } | 118 } |
| 107 } | 119 } |
| 108 | 120 |
| 109 void set references(List<PrelinkedReferenceBuilder> _value) { | 121 void set references(List<PrelinkedReferenceBuilder> _value) { |
| 122 assert(!_finished); | |
| 110 assert(!_json.containsKey("references")); | 123 assert(!_json.containsKey("references")); |
| 111 if (_value != null || _value.isEmpty) { | 124 if (_value != null || _value.isEmpty) { |
| 112 _json["references"] = _value.map((b) => b.finish()).toList(); | 125 _json["references"] = _value.map((b) => b.finish()).toList(); |
| 113 } | 126 } |
| 114 } | 127 } |
| 115 | 128 |
| 116 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); | 129 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); |
| 117 | 130 |
| 118 Map finish() => _json; | 131 Map finish() { |
| 132 assert(!_finished); | |
| 133 _finished = true; | |
| 134 return _json; | |
| 135 } | |
| 119 } | 136 } |
| 120 | 137 |
| 121 PrelinkedLibraryBuilder encodePrelinkedLibrary(builder.BuilderContext builderCon text, {UnlinkedLibraryBuilder unlinked, List<PrelinkedDependencyBuilder> depende ncies, List<int> importDependencies, List<PrelinkedReferenceBuilder> references} ) { | 138 PrelinkedLibraryBuilder encodePrelinkedLibrary(builder.BuilderContext builderCon text, {UnlinkedLibraryBuilder unlinked, List<PrelinkedDependencyBuilder> depende ncies, List<int> importDependencies, List<PrelinkedReferenceBuilder> references} ) { |
| 122 PrelinkedLibraryBuilder builder = new PrelinkedLibraryBuilder(builderContext); | 139 PrelinkedLibraryBuilder builder = new PrelinkedLibraryBuilder(builderContext); |
| 123 builder.unlinked = unlinked; | 140 builder.unlinked = unlinked; |
| 124 builder.dependencies = dependencies; | 141 builder.dependencies = dependencies; |
| 125 builder.importDependencies = importDependencies; | 142 builder.importDependencies = importDependencies; |
| 126 builder.references = references; | 143 builder.references = references; |
| 127 return builder; | 144 return builder; |
| 128 } | 145 } |
| 129 | 146 |
| 130 class PrelinkedReference { | 147 class PrelinkedReference { |
| 131 int _dependency; | 148 int _dependency; |
| 132 PrelinkedReferenceKind _kind; | 149 PrelinkedReferenceKind _kind; |
| 133 int _unit; | 150 int _unit; |
| 134 | 151 |
| 135 PrelinkedReference.fromJson(Map json) | 152 PrelinkedReference.fromJson(Map json) |
| 136 : _dependency = json["dependency"], | 153 : _dependency = json["dependency"], |
| 137 _kind = json["kind"] == null ? null : PrelinkedReferenceKind.values[json[" kind"]], | 154 _kind = json["kind"] == null ? null : PrelinkedReferenceKind.values[json[" kind"]], |
| 138 _unit = json["unit"]; | 155 _unit = json["unit"]; |
| 139 | 156 |
| 140 int get dependency => _dependency ?? 0; | 157 int get dependency => _dependency ?? 0; |
| 141 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ; | 158 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ; |
| 142 int get unit => _unit ?? 0; | 159 int get unit => _unit ?? 0; |
| 143 } | 160 } |
| 144 | 161 |
| 145 class PrelinkedReferenceBuilder { | 162 class PrelinkedReferenceBuilder { |
| 146 final Map _json = {}; | 163 final Map _json = {}; |
| 147 | 164 |
| 165 bool _finished = false; | |
| 166 | |
| 148 PrelinkedReferenceBuilder(builder.BuilderContext context); | 167 PrelinkedReferenceBuilder(builder.BuilderContext context); |
| 149 | 168 |
| 150 void set dependency(int _value) { | 169 void set dependency(int _value) { |
| 170 assert(!_finished); | |
| 151 assert(!_json.containsKey("dependency")); | 171 assert(!_json.containsKey("dependency")); |
| 152 if (_value != null) { | 172 if (_value != null) { |
| 153 _json["dependency"] = _value; | 173 _json["dependency"] = _value; |
| 154 } | 174 } |
| 155 } | 175 } |
| 156 | 176 |
| 157 void set kind(PrelinkedReferenceKind _value) { | 177 void set kind(PrelinkedReferenceKind _value) { |
| 178 assert(!_finished); | |
| 158 assert(!_json.containsKey("kind")); | 179 assert(!_json.containsKey("kind")); |
| 159 if (_value != null || _value == PrelinkedReferenceKind.classOrEnum) { | 180 if (_value != null || _value == PrelinkedReferenceKind.classOrEnum) { |
| 160 _json["kind"] = _value.index; | 181 _json["kind"] = _value.index; |
| 161 } | 182 } |
| 162 } | 183 } |
| 163 | 184 |
| 164 void set unit(int _value) { | 185 void set unit(int _value) { |
| 186 assert(!_finished); | |
| 165 assert(!_json.containsKey("unit")); | 187 assert(!_json.containsKey("unit")); |
| 166 if (_value != null) { | 188 if (_value != null) { |
| 167 _json["unit"] = _value; | 189 _json["unit"] = _value; |
| 168 } | 190 } |
| 169 } | 191 } |
| 170 | 192 |
| 171 Map finish() => _json; | 193 Map finish() { |
| 194 assert(!_finished); | |
| 195 _finished = true; | |
| 196 return _json; | |
| 197 } | |
| 172 } | 198 } |
| 173 | 199 |
| 174 PrelinkedReferenceBuilder encodePrelinkedReference(builder.BuilderContext builde rContext, {int dependency, PrelinkedReferenceKind kind, int unit}) { | 200 PrelinkedReferenceBuilder encodePrelinkedReference(builder.BuilderContext builde rContext, {int dependency, PrelinkedReferenceKind kind, int unit}) { |
| 175 PrelinkedReferenceBuilder builder = new PrelinkedReferenceBuilder(builderConte xt); | 201 PrelinkedReferenceBuilder builder = new PrelinkedReferenceBuilder(builderConte xt); |
| 176 builder.dependency = dependency; | 202 builder.dependency = dependency; |
| 177 builder.kind = kind; | 203 builder.kind = kind; |
| 178 builder.unit = unit; | 204 builder.unit = unit; |
| 179 return builder; | 205 return builder; |
| 180 } | 206 } |
| 181 | 207 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 211 List<UnlinkedTypeRef> get interfaces => _interfaces ?? const <UnlinkedTypeRef> []; | 237 List<UnlinkedTypeRef> get interfaces => _interfaces ?? const <UnlinkedTypeRef> []; |
| 212 List<UnlinkedVariable> get fields => _fields ?? const <UnlinkedVariable>[]; | 238 List<UnlinkedVariable> get fields => _fields ?? const <UnlinkedVariable>[]; |
| 213 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[]; | 239 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[]; |
| 214 bool get isAbstract => _isAbstract ?? false; | 240 bool get isAbstract => _isAbstract ?? false; |
| 215 bool get isMixinApplication => _isMixinApplication ?? false; | 241 bool get isMixinApplication => _isMixinApplication ?? false; |
| 216 } | 242 } |
| 217 | 243 |
| 218 class UnlinkedClassBuilder { | 244 class UnlinkedClassBuilder { |
| 219 final Map _json = {}; | 245 final Map _json = {}; |
| 220 | 246 |
| 247 bool _finished = false; | |
| 248 | |
| 221 UnlinkedClassBuilder(builder.BuilderContext context); | 249 UnlinkedClassBuilder(builder.BuilderContext context); |
| 222 | 250 |
| 223 void set name(String _value) { | 251 void set name(String _value) { |
| 252 assert(!_finished); | |
| 224 assert(!_json.containsKey("name")); | 253 assert(!_json.containsKey("name")); |
| 225 if (_value != null) { | 254 if (_value != null) { |
| 226 _json["name"] = _value; | 255 _json["name"] = _value; |
| 227 } | 256 } |
| 228 } | 257 } |
| 229 | 258 |
| 230 void set unit(int _value) { | 259 void set unit(int _value) { |
| 260 assert(!_finished); | |
| 231 assert(!_json.containsKey("unit")); | 261 assert(!_json.containsKey("unit")); |
| 232 if (_value != null) { | 262 if (_value != null) { |
| 233 _json["unit"] = _value; | 263 _json["unit"] = _value; |
| 234 } | 264 } |
| 235 } | 265 } |
| 236 | 266 |
| 237 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 267 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 268 assert(!_finished); | |
| 238 assert(!_json.containsKey("typeParameters")); | 269 assert(!_json.containsKey("typeParameters")); |
| 239 if (_value != null || _value.isEmpty) { | 270 if (_value != null || _value.isEmpty) { |
| 240 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 271 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 241 } | 272 } |
| 242 } | 273 } |
| 243 | 274 |
| 244 void set supertype(UnlinkedTypeRefBuilder _value) { | 275 void set supertype(UnlinkedTypeRefBuilder _value) { |
| 276 assert(!_finished); | |
| 245 assert(!_json.containsKey("supertype")); | 277 assert(!_json.containsKey("supertype")); |
| 246 if (_value != null) { | 278 if (_value != null) { |
| 247 _json["supertype"] = _value.finish(); | 279 _json["supertype"] = _value.finish(); |
| 248 } | 280 } |
| 249 } | 281 } |
| 250 | 282 |
| 251 void set mixins(List<UnlinkedTypeRefBuilder> _value) { | 283 void set mixins(List<UnlinkedTypeRefBuilder> _value) { |
| 284 assert(!_finished); | |
| 252 assert(!_json.containsKey("mixins")); | 285 assert(!_json.containsKey("mixins")); |
| 253 if (_value != null || _value.isEmpty) { | 286 if (_value != null || _value.isEmpty) { |
| 254 _json["mixins"] = _value.map((b) => b.finish()).toList(); | 287 _json["mixins"] = _value.map((b) => b.finish()).toList(); |
| 255 } | 288 } |
| 256 } | 289 } |
| 257 | 290 |
| 258 void set interfaces(List<UnlinkedTypeRefBuilder> _value) { | 291 void set interfaces(List<UnlinkedTypeRefBuilder> _value) { |
| 292 assert(!_finished); | |
| 259 assert(!_json.containsKey("interfaces")); | 293 assert(!_json.containsKey("interfaces")); |
| 260 if (_value != null || _value.isEmpty) { | 294 if (_value != null || _value.isEmpty) { |
| 261 _json["interfaces"] = _value.map((b) => b.finish()).toList(); | 295 _json["interfaces"] = _value.map((b) => b.finish()).toList(); |
| 262 } | 296 } |
| 263 } | 297 } |
| 264 | 298 |
| 265 void set fields(List<UnlinkedVariableBuilder> _value) { | 299 void set fields(List<UnlinkedVariableBuilder> _value) { |
| 300 assert(!_finished); | |
| 266 assert(!_json.containsKey("fields")); | 301 assert(!_json.containsKey("fields")); |
| 267 if (_value != null || _value.isEmpty) { | 302 if (_value != null || _value.isEmpty) { |
| 268 _json["fields"] = _value.map((b) => b.finish()).toList(); | 303 _json["fields"] = _value.map((b) => b.finish()).toList(); |
| 269 } | 304 } |
| 270 } | 305 } |
| 271 | 306 |
| 272 void set executables(List<UnlinkedExecutableBuilder> _value) { | 307 void set executables(List<UnlinkedExecutableBuilder> _value) { |
| 308 assert(!_finished); | |
| 273 assert(!_json.containsKey("executables")); | 309 assert(!_json.containsKey("executables")); |
| 274 if (_value != null || _value.isEmpty) { | 310 if (_value != null || _value.isEmpty) { |
| 275 _json["executables"] = _value.map((b) => b.finish()).toList(); | 311 _json["executables"] = _value.map((b) => b.finish()).toList(); |
| 276 } | 312 } |
| 277 } | 313 } |
| 278 | 314 |
| 279 void set isAbstract(bool _value) { | 315 void set isAbstract(bool _value) { |
| 316 assert(!_finished); | |
| 280 assert(!_json.containsKey("isAbstract")); | 317 assert(!_json.containsKey("isAbstract")); |
| 281 if (_value != null) { | 318 if (_value != null) { |
| 282 _json["isAbstract"] = _value; | 319 _json["isAbstract"] = _value; |
| 283 } | 320 } |
| 284 } | 321 } |
| 285 | 322 |
| 286 void set isMixinApplication(bool _value) { | 323 void set isMixinApplication(bool _value) { |
| 324 assert(!_finished); | |
| 287 assert(!_json.containsKey("isMixinApplication")); | 325 assert(!_json.containsKey("isMixinApplication")); |
| 288 if (_value != null) { | 326 if (_value != null) { |
| 289 _json["isMixinApplication"] = _value; | 327 _json["isMixinApplication"] = _value; |
| 290 } | 328 } |
| 291 } | 329 } |
| 292 | 330 |
| 293 Map finish() => _json; | 331 Map finish() { |
| 332 assert(!_finished); | |
| 333 _finished = true; | |
| 334 return _json; | |
| 335 } | |
| 294 } | 336 } |
| 295 | 337 |
| 296 UnlinkedClassBuilder encodeUnlinkedClass(builder.BuilderContext builderContext, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedT ypeRefBuilder supertype, List<UnlinkedTypeRefBuilder> mixins, List<UnlinkedTypeR efBuilder> interfaces, List<UnlinkedVariableBuilder> fields, List<UnlinkedExecut ableBuilder> executables, bool isAbstract, bool isMixinApplication}) { | 338 UnlinkedClassBuilder encodeUnlinkedClass(builder.BuilderContext builderContext, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedT ypeRefBuilder supertype, List<UnlinkedTypeRefBuilder> mixins, List<UnlinkedTypeR efBuilder> interfaces, List<UnlinkedVariableBuilder> fields, List<UnlinkedExecut ableBuilder> executables, bool isAbstract, bool isMixinApplication}) { |
| 297 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); | 339 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); |
| 298 builder.name = name; | 340 builder.name = name; |
| 299 builder.unit = unit; | 341 builder.unit = unit; |
| 300 builder.typeParameters = typeParameters; | 342 builder.typeParameters = typeParameters; |
| 301 builder.supertype = supertype; | 343 builder.supertype = supertype; |
| 302 builder.mixins = mixins; | 344 builder.mixins = mixins; |
| 303 builder.interfaces = interfaces; | 345 builder.interfaces = interfaces; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 316 : _shows = json["shows"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList(), | 358 : _shows = json["shows"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList(), |
| 317 _hides = json["hides"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList(); | 359 _hides = json["hides"]?.map((x) => new UnlinkedCombinatorName.fromJson(x)) ?.toList(); |
| 318 | 360 |
| 319 List<UnlinkedCombinatorName> get shows => _shows ?? const <UnlinkedCombinatorN ame>[]; | 361 List<UnlinkedCombinatorName> get shows => _shows ?? const <UnlinkedCombinatorN ame>[]; |
| 320 List<UnlinkedCombinatorName> get hides => _hides ?? const <UnlinkedCombinatorN ame>[]; | 362 List<UnlinkedCombinatorName> get hides => _hides ?? const <UnlinkedCombinatorN ame>[]; |
| 321 } | 363 } |
| 322 | 364 |
| 323 class UnlinkedCombinatorBuilder { | 365 class UnlinkedCombinatorBuilder { |
| 324 final Map _json = {}; | 366 final Map _json = {}; |
| 325 | 367 |
| 368 bool _finished = false; | |
| 369 | |
| 326 UnlinkedCombinatorBuilder(builder.BuilderContext context); | 370 UnlinkedCombinatorBuilder(builder.BuilderContext context); |
| 327 | 371 |
| 328 void set shows(List<UnlinkedCombinatorNameBuilder> _value) { | 372 void set shows(List<UnlinkedCombinatorNameBuilder> _value) { |
| 373 assert(!_finished); | |
| 329 assert(!_json.containsKey("shows")); | 374 assert(!_json.containsKey("shows")); |
| 330 if (_value != null || _value.isEmpty) { | 375 if (_value != null || _value.isEmpty) { |
| 331 _json["shows"] = _value.map((b) => b.finish()).toList(); | 376 _json["shows"] = _value.map((b) => b.finish()).toList(); |
| 332 } | 377 } |
| 333 } | 378 } |
| 334 | 379 |
| 335 void set hides(List<UnlinkedCombinatorNameBuilder> _value) { | 380 void set hides(List<UnlinkedCombinatorNameBuilder> _value) { |
| 381 assert(!_finished); | |
| 336 assert(!_json.containsKey("hides")); | 382 assert(!_json.containsKey("hides")); |
| 337 if (_value != null || _value.isEmpty) { | 383 if (_value != null || _value.isEmpty) { |
| 338 _json["hides"] = _value.map((b) => b.finish()).toList(); | 384 _json["hides"] = _value.map((b) => b.finish()).toList(); |
| 339 } | 385 } |
| 340 } | 386 } |
| 341 | 387 |
| 342 Map finish() => _json; | 388 Map finish() { |
| 389 assert(!_finished); | |
| 390 _finished = true; | |
| 391 return _json; | |
| 392 } | |
| 343 } | 393 } |
| 344 | 394 |
| 345 UnlinkedCombinatorBuilder encodeUnlinkedCombinator(builder.BuilderContext builde rContext, {List<UnlinkedCombinatorNameBuilder> shows, List<UnlinkedCombinatorNam eBuilder> hides}) { | 395 UnlinkedCombinatorBuilder encodeUnlinkedCombinator(builder.BuilderContext builde rContext, {List<UnlinkedCombinatorNameBuilder> shows, List<UnlinkedCombinatorNam eBuilder> hides}) { |
| 346 UnlinkedCombinatorBuilder builder = new UnlinkedCombinatorBuilder(builderConte xt); | 396 UnlinkedCombinatorBuilder builder = new UnlinkedCombinatorBuilder(builderConte xt); |
| 347 builder.shows = shows; | 397 builder.shows = shows; |
| 348 builder.hides = hides; | 398 builder.hides = hides; |
| 349 return builder; | 399 return builder; |
| 350 } | 400 } |
| 351 | 401 |
| 352 class UnlinkedCombinatorName { | 402 class UnlinkedCombinatorName { |
| 353 String _name; | 403 String _name; |
| 354 | 404 |
| 355 UnlinkedCombinatorName.fromJson(Map json) | 405 UnlinkedCombinatorName.fromJson(Map json) |
| 356 : _name = json["name"]; | 406 : _name = json["name"]; |
| 357 | 407 |
| 358 String get name => _name ?? ''; | 408 String get name => _name ?? ''; |
| 359 } | 409 } |
| 360 | 410 |
| 361 class UnlinkedCombinatorNameBuilder { | 411 class UnlinkedCombinatorNameBuilder { |
| 362 final Map _json = {}; | 412 final Map _json = {}; |
| 363 | 413 |
| 414 bool _finished = false; | |
| 415 | |
| 364 UnlinkedCombinatorNameBuilder(builder.BuilderContext context); | 416 UnlinkedCombinatorNameBuilder(builder.BuilderContext context); |
| 365 | 417 |
| 366 void set name(String _value) { | 418 void set name(String _value) { |
| 419 assert(!_finished); | |
| 367 assert(!_json.containsKey("name")); | 420 assert(!_json.containsKey("name")); |
| 368 if (_value != null) { | 421 if (_value != null) { |
| 369 _json["name"] = _value; | 422 _json["name"] = _value; |
| 370 } | 423 } |
| 371 } | 424 } |
| 372 | 425 |
| 373 Map finish() => _json; | 426 Map finish() { |
| 427 assert(!_finished); | |
| 428 _finished = true; | |
| 429 return _json; | |
| 430 } | |
| 374 } | 431 } |
| 375 | 432 |
| 376 UnlinkedCombinatorNameBuilder encodeUnlinkedCombinatorName(builder.BuilderContex t builderContext, {String name}) { | 433 UnlinkedCombinatorNameBuilder encodeUnlinkedCombinatorName(builder.BuilderContex t builderContext, {String name}) { |
| 377 UnlinkedCombinatorNameBuilder builder = new UnlinkedCombinatorNameBuilder(buil derContext); | 434 UnlinkedCombinatorNameBuilder builder = new UnlinkedCombinatorNameBuilder(buil derContext); |
| 378 builder.name = name; | 435 builder.name = name; |
| 379 return builder; | 436 return builder; |
| 380 } | 437 } |
| 381 | 438 |
| 382 class UnlinkedEnum { | 439 class UnlinkedEnum { |
| 383 String _name; | 440 String _name; |
| 384 List<UnlinkedEnumValue> _values; | 441 List<UnlinkedEnumValue> _values; |
| 385 int _unit; | 442 int _unit; |
| 386 | 443 |
| 387 UnlinkedEnum.fromJson(Map json) | 444 UnlinkedEnum.fromJson(Map json) |
| 388 : _name = json["name"], | 445 : _name = json["name"], |
| 389 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t oList(), | 446 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t oList(), |
| 390 _unit = json["unit"]; | 447 _unit = json["unit"]; |
| 391 | 448 |
| 392 String get name => _name ?? ''; | 449 String get name => _name ?? ''; |
| 393 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; | 450 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; |
| 394 int get unit => _unit ?? 0; | 451 int get unit => _unit ?? 0; |
| 395 } | 452 } |
| 396 | 453 |
| 397 class UnlinkedEnumBuilder { | 454 class UnlinkedEnumBuilder { |
| 398 final Map _json = {}; | 455 final Map _json = {}; |
| 399 | 456 |
| 457 bool _finished = false; | |
| 458 | |
| 400 UnlinkedEnumBuilder(builder.BuilderContext context); | 459 UnlinkedEnumBuilder(builder.BuilderContext context); |
| 401 | 460 |
| 402 void set name(String _value) { | 461 void set name(String _value) { |
| 462 assert(!_finished); | |
| 403 assert(!_json.containsKey("name")); | 463 assert(!_json.containsKey("name")); |
| 404 if (_value != null) { | 464 if (_value != null) { |
| 405 _json["name"] = _value; | 465 _json["name"] = _value; |
| 406 } | 466 } |
| 407 } | 467 } |
| 408 | 468 |
| 409 void set values(List<UnlinkedEnumValueBuilder> _value) { | 469 void set values(List<UnlinkedEnumValueBuilder> _value) { |
| 470 assert(!_finished); | |
| 410 assert(!_json.containsKey("values")); | 471 assert(!_json.containsKey("values")); |
| 411 if (_value != null || _value.isEmpty) { | 472 if (_value != null || _value.isEmpty) { |
| 412 _json["values"] = _value.map((b) => b.finish()).toList(); | 473 _json["values"] = _value.map((b) => b.finish()).toList(); |
| 413 } | 474 } |
| 414 } | 475 } |
| 415 | 476 |
| 416 void set unit(int _value) { | 477 void set unit(int _value) { |
| 478 assert(!_finished); | |
| 417 assert(!_json.containsKey("unit")); | 479 assert(!_json.containsKey("unit")); |
| 418 if (_value != null) { | 480 if (_value != null) { |
| 419 _json["unit"] = _value; | 481 _json["unit"] = _value; |
| 420 } | 482 } |
| 421 } | 483 } |
| 422 | 484 |
| 423 Map finish() => _json; | 485 Map finish() { |
| 486 assert(!_finished); | |
| 487 _finished = true; | |
| 488 return _json; | |
| 489 } | |
| 424 } | 490 } |
| 425 | 491 |
| 426 UnlinkedEnumBuilder encodeUnlinkedEnum(builder.BuilderContext builderContext, {S tring name, List<UnlinkedEnumValueBuilder> values, int unit}) { | 492 UnlinkedEnumBuilder encodeUnlinkedEnum(builder.BuilderContext builderContext, {S tring name, List<UnlinkedEnumValueBuilder> values, int unit}) { |
| 427 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); | 493 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); |
| 428 builder.name = name; | 494 builder.name = name; |
| 429 builder.values = values; | 495 builder.values = values; |
| 430 builder.unit = unit; | 496 builder.unit = unit; |
| 431 return builder; | 497 return builder; |
| 432 } | 498 } |
| 433 | 499 |
| 434 class UnlinkedEnumValue { | 500 class UnlinkedEnumValue { |
| 435 String _name; | 501 String _name; |
| 436 | 502 |
| 437 UnlinkedEnumValue.fromJson(Map json) | 503 UnlinkedEnumValue.fromJson(Map json) |
| 438 : _name = json["name"]; | 504 : _name = json["name"]; |
| 439 | 505 |
| 440 String get name => _name ?? ''; | 506 String get name => _name ?? ''; |
| 441 } | 507 } |
| 442 | 508 |
| 443 class UnlinkedEnumValueBuilder { | 509 class UnlinkedEnumValueBuilder { |
| 444 final Map _json = {}; | 510 final Map _json = {}; |
| 445 | 511 |
| 512 bool _finished = false; | |
| 513 | |
| 446 UnlinkedEnumValueBuilder(builder.BuilderContext context); | 514 UnlinkedEnumValueBuilder(builder.BuilderContext context); |
| 447 | 515 |
| 448 void set name(String _value) { | 516 void set name(String _value) { |
| 517 assert(!_finished); | |
| 449 assert(!_json.containsKey("name")); | 518 assert(!_json.containsKey("name")); |
| 450 if (_value != null) { | 519 if (_value != null) { |
| 451 _json["name"] = _value; | 520 _json["name"] = _value; |
| 452 } | 521 } |
| 453 } | 522 } |
| 454 | 523 |
| 455 Map finish() => _json; | 524 Map finish() { |
| 525 assert(!_finished); | |
| 526 _finished = true; | |
| 527 return _json; | |
| 528 } | |
| 456 } | 529 } |
| 457 | 530 |
| 458 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(builder.BuilderContext builderC ontext, {String name}) { | 531 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(builder.BuilderContext builderC ontext, {String name}) { |
| 459 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext ); | 532 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext ); |
| 460 builder.name = name; | 533 builder.name = name; |
| 461 return builder; | 534 return builder; |
| 462 } | 535 } |
| 463 | 536 |
| 464 class UnlinkedExecutable { | 537 class UnlinkedExecutable { |
| 465 String _name; | 538 String _name; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 496 bool get isAbstract => _isAbstract ?? false; | 569 bool get isAbstract => _isAbstract ?? false; |
| 497 bool get isStatic => _isStatic ?? false; | 570 bool get isStatic => _isStatic ?? false; |
| 498 bool get isConst => _isConst ?? false; | 571 bool get isConst => _isConst ?? false; |
| 499 bool get isFactory => _isFactory ?? false; | 572 bool get isFactory => _isFactory ?? false; |
| 500 bool get hasImplicitReturnType => _hasImplicitReturnType ?? false; | 573 bool get hasImplicitReturnType => _hasImplicitReturnType ?? false; |
| 501 } | 574 } |
| 502 | 575 |
| 503 class UnlinkedExecutableBuilder { | 576 class UnlinkedExecutableBuilder { |
| 504 final Map _json = {}; | 577 final Map _json = {}; |
| 505 | 578 |
| 579 bool _finished = false; | |
| 580 | |
| 506 UnlinkedExecutableBuilder(builder.BuilderContext context); | 581 UnlinkedExecutableBuilder(builder.BuilderContext context); |
| 507 | 582 |
| 508 void set name(String _value) { | 583 void set name(String _value) { |
| 584 assert(!_finished); | |
| 509 assert(!_json.containsKey("name")); | 585 assert(!_json.containsKey("name")); |
| 510 if (_value != null) { | 586 if (_value != null) { |
| 511 _json["name"] = _value; | 587 _json["name"] = _value; |
| 512 } | 588 } |
| 513 } | 589 } |
| 514 | 590 |
| 515 void set unit(int _value) { | 591 void set unit(int _value) { |
| 592 assert(!_finished); | |
| 516 assert(!_json.containsKey("unit")); | 593 assert(!_json.containsKey("unit")); |
| 517 if (_value != null) { | 594 if (_value != null) { |
| 518 _json["unit"] = _value; | 595 _json["unit"] = _value; |
| 519 } | 596 } |
| 520 } | 597 } |
| 521 | 598 |
| 522 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 599 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 600 assert(!_finished); | |
| 523 assert(!_json.containsKey("typeParameters")); | 601 assert(!_json.containsKey("typeParameters")); |
| 524 if (_value != null || _value.isEmpty) { | 602 if (_value != null || _value.isEmpty) { |
| 525 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 603 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 526 } | 604 } |
| 527 } | 605 } |
| 528 | 606 |
| 529 void set returnType(UnlinkedTypeRefBuilder _value) { | 607 void set returnType(UnlinkedTypeRefBuilder _value) { |
| 608 assert(!_finished); | |
| 530 assert(!_json.containsKey("returnType")); | 609 assert(!_json.containsKey("returnType")); |
| 531 if (_value != null) { | 610 if (_value != null) { |
| 532 _json["returnType"] = _value.finish(); | 611 _json["returnType"] = _value.finish(); |
| 533 } | 612 } |
| 534 } | 613 } |
| 535 | 614 |
| 536 void set parameters(List<UnlinkedParamBuilder> _value) { | 615 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 616 assert(!_finished); | |
| 537 assert(!_json.containsKey("parameters")); | 617 assert(!_json.containsKey("parameters")); |
| 538 if (_value != null || _value.isEmpty) { | 618 if (_value != null || _value.isEmpty) { |
| 539 _json["parameters"] = _value.map((b) => b.finish()).toList(); | 619 _json["parameters"] = _value.map((b) => b.finish()).toList(); |
| 540 } | 620 } |
| 541 } | 621 } |
| 542 | 622 |
| 543 void set kind(UnlinkedExecutableKind _value) { | 623 void set kind(UnlinkedExecutableKind _value) { |
| 624 assert(!_finished); | |
| 544 assert(!_json.containsKey("kind")); | 625 assert(!_json.containsKey("kind")); |
| 545 if (_value != null || _value == UnlinkedExecutableKind.functionOrMethod) { | 626 if (_value != null || _value == UnlinkedExecutableKind.functionOrMethod) { |
| 546 _json["kind"] = _value.index; | 627 _json["kind"] = _value.index; |
| 547 } | 628 } |
| 548 } | 629 } |
| 549 | 630 |
| 550 void set isAbstract(bool _value) { | 631 void set isAbstract(bool _value) { |
| 632 assert(!_finished); | |
| 551 assert(!_json.containsKey("isAbstract")); | 633 assert(!_json.containsKey("isAbstract")); |
| 552 if (_value != null) { | 634 if (_value != null) { |
| 553 _json["isAbstract"] = _value; | 635 _json["isAbstract"] = _value; |
| 554 } | 636 } |
| 555 } | 637 } |
| 556 | 638 |
| 557 void set isStatic(bool _value) { | 639 void set isStatic(bool _value) { |
| 640 assert(!_finished); | |
| 558 assert(!_json.containsKey("isStatic")); | 641 assert(!_json.containsKey("isStatic")); |
| 559 if (_value != null) { | 642 if (_value != null) { |
| 560 _json["isStatic"] = _value; | 643 _json["isStatic"] = _value; |
| 561 } | 644 } |
| 562 } | 645 } |
| 563 | 646 |
| 564 void set isConst(bool _value) { | 647 void set isConst(bool _value) { |
| 648 assert(!_finished); | |
| 565 assert(!_json.containsKey("isConst")); | 649 assert(!_json.containsKey("isConst")); |
| 566 if (_value != null) { | 650 if (_value != null) { |
| 567 _json["isConst"] = _value; | 651 _json["isConst"] = _value; |
| 568 } | 652 } |
| 569 } | 653 } |
| 570 | 654 |
| 571 void set isFactory(bool _value) { | 655 void set isFactory(bool _value) { |
| 656 assert(!_finished); | |
| 572 assert(!_json.containsKey("isFactory")); | 657 assert(!_json.containsKey("isFactory")); |
| 573 if (_value != null) { | 658 if (_value != null) { |
| 574 _json["isFactory"] = _value; | 659 _json["isFactory"] = _value; |
| 575 } | 660 } |
| 576 } | 661 } |
| 577 | 662 |
| 578 void set hasImplicitReturnType(bool _value) { | 663 void set hasImplicitReturnType(bool _value) { |
| 664 assert(!_finished); | |
| 579 assert(!_json.containsKey("hasImplicitReturnType")); | 665 assert(!_json.containsKey("hasImplicitReturnType")); |
| 580 if (_value != null) { | 666 if (_value != null) { |
| 581 _json["hasImplicitReturnType"] = _value; | 667 _json["hasImplicitReturnType"] = _value; |
| 582 } | 668 } |
| 583 } | 669 } |
| 584 | 670 |
| 585 Map finish() => _json; | 671 Map finish() { |
| 672 assert(!_finished); | |
| 673 _finished = true; | |
| 674 return _json; | |
| 675 } | |
| 586 } | 676 } |
| 587 | 677 |
| 588 UnlinkedExecutableBuilder encodeUnlinkedExecutable(builder.BuilderContext builde rContext, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters, Unlin kedExecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFac tory, bool hasImplicitReturnType}) { | 678 UnlinkedExecutableBuilder encodeUnlinkedExecutable(builder.BuilderContext builde rContext, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters, Unlin kedExecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFac tory, bool hasImplicitReturnType}) { |
| 589 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte xt); | 679 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte xt); |
| 590 builder.name = name; | 680 builder.name = name; |
| 591 builder.unit = unit; | 681 builder.unit = unit; |
| 592 builder.typeParameters = typeParameters; | 682 builder.typeParameters = typeParameters; |
| 593 builder.returnType = returnType; | 683 builder.returnType = returnType; |
| 594 builder.parameters = parameters; | 684 builder.parameters = parameters; |
| 595 builder.kind = kind; | 685 builder.kind = kind; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 609 : _uri = json["uri"], | 699 : _uri = json["uri"], |
| 610 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from Json(x))?.toList(); | 700 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from Json(x))?.toList(); |
| 611 | 701 |
| 612 String get uri => _uri ?? ''; | 702 String get uri => _uri ?? ''; |
| 613 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[]; | 703 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[]; |
| 614 } | 704 } |
| 615 | 705 |
| 616 class UnlinkedExportBuilder { | 706 class UnlinkedExportBuilder { |
| 617 final Map _json = {}; | 707 final Map _json = {}; |
| 618 | 708 |
| 709 bool _finished = false; | |
| 710 | |
| 619 UnlinkedExportBuilder(builder.BuilderContext context); | 711 UnlinkedExportBuilder(builder.BuilderContext context); |
| 620 | 712 |
| 621 void set uri(String _value) { | 713 void set uri(String _value) { |
| 714 assert(!_finished); | |
| 622 assert(!_json.containsKey("uri")); | 715 assert(!_json.containsKey("uri")); |
| 623 if (_value != null) { | 716 if (_value != null) { |
| 624 _json["uri"] = _value; | 717 _json["uri"] = _value; |
| 625 } | 718 } |
| 626 } | 719 } |
| 627 | 720 |
| 628 void set combinators(List<UnlinkedCombinatorBuilder> _value) { | 721 void set combinators(List<UnlinkedCombinatorBuilder> _value) { |
| 722 assert(!_finished); | |
| 629 assert(!_json.containsKey("combinators")); | 723 assert(!_json.containsKey("combinators")); |
| 630 if (_value != null || _value.isEmpty) { | 724 if (_value != null || _value.isEmpty) { |
| 631 _json["combinators"] = _value.map((b) => b.finish()).toList(); | 725 _json["combinators"] = _value.map((b) => b.finish()).toList(); |
| 632 } | 726 } |
| 633 } | 727 } |
| 634 | 728 |
| 635 Map finish() => _json; | 729 Map finish() { |
| 730 assert(!_finished); | |
| 731 _finished = true; | |
| 732 return _json; | |
| 733 } | |
| 636 } | 734 } |
| 637 | 735 |
| 638 UnlinkedExportBuilder encodeUnlinkedExport(builder.BuilderContext builderContext , {String uri, List<UnlinkedCombinatorBuilder> combinators}) { | 736 UnlinkedExportBuilder encodeUnlinkedExport(builder.BuilderContext builderContext , {String uri, List<UnlinkedCombinatorBuilder> combinators}) { |
| 639 UnlinkedExportBuilder builder = new UnlinkedExportBuilder(builderContext); | 737 UnlinkedExportBuilder builder = new UnlinkedExportBuilder(builderContext); |
| 640 builder.uri = uri; | 738 builder.uri = uri; |
| 641 builder.combinators = combinators; | 739 builder.combinators = combinators; |
| 642 return builder; | 740 return builder; |
| 643 } | 741 } |
| 644 | 742 |
| 645 class UnlinkedImport { | 743 class UnlinkedImport { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 662 int get offset => _offset ?? 0; | 760 int get offset => _offset ?? 0; |
| 663 int get prefix => _prefix ?? 0; | 761 int get prefix => _prefix ?? 0; |
| 664 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[]; | 762 List<UnlinkedCombinator> get combinators => _combinators ?? const <UnlinkedCom binator>[]; |
| 665 bool get isDeferred => _isDeferred ?? false; | 763 bool get isDeferred => _isDeferred ?? false; |
| 666 bool get isImplicit => _isImplicit ?? false; | 764 bool get isImplicit => _isImplicit ?? false; |
| 667 } | 765 } |
| 668 | 766 |
| 669 class UnlinkedImportBuilder { | 767 class UnlinkedImportBuilder { |
| 670 final Map _json = {}; | 768 final Map _json = {}; |
| 671 | 769 |
| 770 bool _finished = false; | |
| 771 | |
| 672 UnlinkedImportBuilder(builder.BuilderContext context); | 772 UnlinkedImportBuilder(builder.BuilderContext context); |
| 673 | 773 |
| 674 void set uri(String _value) { | 774 void set uri(String _value) { |
| 775 assert(!_finished); | |
| 675 assert(!_json.containsKey("uri")); | 776 assert(!_json.containsKey("uri")); |
| 676 if (_value != null) { | 777 if (_value != null) { |
| 677 _json["uri"] = _value; | 778 _json["uri"] = _value; |
| 678 } | 779 } |
| 679 } | 780 } |
| 680 | 781 |
| 681 void set offset(int _value) { | 782 void set offset(int _value) { |
| 783 assert(!_finished); | |
| 682 assert(!_json.containsKey("offset")); | 784 assert(!_json.containsKey("offset")); |
| 683 if (_value != null) { | 785 if (_value != null) { |
| 684 _json["offset"] = _value; | 786 _json["offset"] = _value; |
| 685 } | 787 } |
| 686 } | 788 } |
| 687 | 789 |
| 688 void set prefix(int _value) { | 790 void set prefix(int _value) { |
| 791 assert(!_finished); | |
| 689 assert(!_json.containsKey("prefix")); | 792 assert(!_json.containsKey("prefix")); |
| 690 if (_value != null) { | 793 if (_value != null) { |
| 691 _json["prefix"] = _value; | 794 _json["prefix"] = _value; |
| 692 } | 795 } |
| 693 } | 796 } |
| 694 | 797 |
| 695 void set combinators(List<UnlinkedCombinatorBuilder> _value) { | 798 void set combinators(List<UnlinkedCombinatorBuilder> _value) { |
| 799 assert(!_finished); | |
| 696 assert(!_json.containsKey("combinators")); | 800 assert(!_json.containsKey("combinators")); |
| 697 if (_value != null || _value.isEmpty) { | 801 if (_value != null || _value.isEmpty) { |
| 698 _json["combinators"] = _value.map((b) => b.finish()).toList(); | 802 _json["combinators"] = _value.map((b) => b.finish()).toList(); |
| 699 } | 803 } |
| 700 } | 804 } |
| 701 | 805 |
| 702 void set isDeferred(bool _value) { | 806 void set isDeferred(bool _value) { |
| 807 assert(!_finished); | |
| 703 assert(!_json.containsKey("isDeferred")); | 808 assert(!_json.containsKey("isDeferred")); |
| 704 if (_value != null) { | 809 if (_value != null) { |
| 705 _json["isDeferred"] = _value; | 810 _json["isDeferred"] = _value; |
| 706 } | 811 } |
| 707 } | 812 } |
| 708 | 813 |
| 709 void set isImplicit(bool _value) { | 814 void set isImplicit(bool _value) { |
| 815 assert(!_finished); | |
| 710 assert(!_json.containsKey("isImplicit")); | 816 assert(!_json.containsKey("isImplicit")); |
| 711 if (_value != null) { | 817 if (_value != null) { |
| 712 _json["isImplicit"] = _value; | 818 _json["isImplicit"] = _value; |
| 713 } | 819 } |
| 714 } | 820 } |
| 715 | 821 |
| 716 Map finish() => _json; | 822 Map finish() { |
| 823 assert(!_finished); | |
| 824 _finished = true; | |
| 825 return _json; | |
| 826 } | |
| 717 } | 827 } |
| 718 | 828 |
| 719 UnlinkedImportBuilder encodeUnlinkedImport(builder.BuilderContext builderContext , {String uri, int offset, int prefix, List<UnlinkedCombinatorBuilder> combinato rs, bool isDeferred, bool isImplicit}) { | 829 UnlinkedImportBuilder encodeUnlinkedImport(builder.BuilderContext builderContext , {String uri, int offset, int prefix, List<UnlinkedCombinatorBuilder> combinato rs, bool isDeferred, bool isImplicit}) { |
| 720 UnlinkedImportBuilder builder = new UnlinkedImportBuilder(builderContext); | 830 UnlinkedImportBuilder builder = new UnlinkedImportBuilder(builderContext); |
| 721 builder.uri = uri; | 831 builder.uri = uri; |
| 722 builder.offset = offset; | 832 builder.offset = offset; |
| 723 builder.prefix = prefix; | 833 builder.prefix = prefix; |
| 724 builder.combinators = combinators; | 834 builder.combinators = combinators; |
| 725 builder.isDeferred = isDeferred; | 835 builder.isDeferred = isDeferred; |
| 726 builder.isImplicit = isImplicit; | 836 builder.isImplicit = isImplicit; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 List<UnlinkedExport> get exports => _exports ?? const <UnlinkedExport>[]; | 872 List<UnlinkedExport> get exports => _exports ?? const <UnlinkedExport>[]; |
| 763 List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[]; | 873 List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[]; |
| 764 List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[]; | 874 List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[]; |
| 765 List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable> []; | 875 List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable> []; |
| 766 List<UnlinkedPrefix> get prefixes => _prefixes ?? const <UnlinkedPrefix>[]; | 876 List<UnlinkedPrefix> get prefixes => _prefixes ?? const <UnlinkedPrefix>[]; |
| 767 } | 877 } |
| 768 | 878 |
| 769 class UnlinkedLibraryBuilder { | 879 class UnlinkedLibraryBuilder { |
| 770 final Map _json = {}; | 880 final Map _json = {}; |
| 771 | 881 |
| 882 bool _finished = false; | |
| 883 | |
| 772 UnlinkedLibraryBuilder(builder.BuilderContext context); | 884 UnlinkedLibraryBuilder(builder.BuilderContext context); |
| 773 | 885 |
| 774 void set references(List<UnlinkedReferenceBuilder> _value) { | 886 void set references(List<UnlinkedReferenceBuilder> _value) { |
| 887 assert(!_finished); | |
| 775 assert(!_json.containsKey("references")); | 888 assert(!_json.containsKey("references")); |
| 776 if (_value != null || _value.isEmpty) { | 889 if (_value != null || _value.isEmpty) { |
| 777 _json["references"] = _value.map((b) => b.finish()).toList(); | 890 _json["references"] = _value.map((b) => b.finish()).toList(); |
| 778 } | 891 } |
| 779 } | 892 } |
| 780 | 893 |
| 781 void set units(List<UnlinkedUnitBuilder> _value) { | 894 void set units(List<UnlinkedUnitBuilder> _value) { |
| 895 assert(!_finished); | |
| 782 assert(!_json.containsKey("units")); | 896 assert(!_json.containsKey("units")); |
| 783 if (_value != null || _value.isEmpty) { | 897 if (_value != null || _value.isEmpty) { |
| 784 _json["units"] = _value.map((b) => b.finish()).toList(); | 898 _json["units"] = _value.map((b) => b.finish()).toList(); |
| 785 } | 899 } |
| 786 } | 900 } |
| 787 | 901 |
| 788 void set name(String _value) { | 902 void set name(String _value) { |
| 903 assert(!_finished); | |
| 789 assert(!_json.containsKey("name")); | 904 assert(!_json.containsKey("name")); |
| 790 if (_value != null) { | 905 if (_value != null) { |
| 791 _json["name"] = _value; | 906 _json["name"] = _value; |
| 792 } | 907 } |
| 793 } | 908 } |
| 794 | 909 |
| 795 void set classes(List<UnlinkedClassBuilder> _value) { | 910 void set classes(List<UnlinkedClassBuilder> _value) { |
| 911 assert(!_finished); | |
| 796 assert(!_json.containsKey("classes")); | 912 assert(!_json.containsKey("classes")); |
| 797 if (_value != null || _value.isEmpty) { | 913 if (_value != null || _value.isEmpty) { |
| 798 _json["classes"] = _value.map((b) => b.finish()).toList(); | 914 _json["classes"] = _value.map((b) => b.finish()).toList(); |
| 799 } | 915 } |
| 800 } | 916 } |
| 801 | 917 |
| 802 void set enums(List<UnlinkedEnumBuilder> _value) { | 918 void set enums(List<UnlinkedEnumBuilder> _value) { |
| 919 assert(!_finished); | |
| 803 assert(!_json.containsKey("enums")); | 920 assert(!_json.containsKey("enums")); |
| 804 if (_value != null || _value.isEmpty) { | 921 if (_value != null || _value.isEmpty) { |
| 805 _json["enums"] = _value.map((b) => b.finish()).toList(); | 922 _json["enums"] = _value.map((b) => b.finish()).toList(); |
| 806 } | 923 } |
| 807 } | 924 } |
| 808 | 925 |
| 809 void set executables(List<UnlinkedExecutableBuilder> _value) { | 926 void set executables(List<UnlinkedExecutableBuilder> _value) { |
| 927 assert(!_finished); | |
| 810 assert(!_json.containsKey("executables")); | 928 assert(!_json.containsKey("executables")); |
| 811 if (_value != null || _value.isEmpty) { | 929 if (_value != null || _value.isEmpty) { |
| 812 _json["executables"] = _value.map((b) => b.finish()).toList(); | 930 _json["executables"] = _value.map((b) => b.finish()).toList(); |
| 813 } | 931 } |
| 814 } | 932 } |
| 815 | 933 |
| 816 void set exports(List<UnlinkedExportBuilder> _value) { | 934 void set exports(List<UnlinkedExportBuilder> _value) { |
| 935 assert(!_finished); | |
| 817 assert(!_json.containsKey("exports")); | 936 assert(!_json.containsKey("exports")); |
| 818 if (_value != null || _value.isEmpty) { | 937 if (_value != null || _value.isEmpty) { |
| 819 _json["exports"] = _value.map((b) => b.finish()).toList(); | 938 _json["exports"] = _value.map((b) => b.finish()).toList(); |
| 820 } | 939 } |
| 821 } | 940 } |
| 822 | 941 |
| 823 void set imports(List<UnlinkedImportBuilder> _value) { | 942 void set imports(List<UnlinkedImportBuilder> _value) { |
| 943 assert(!_finished); | |
| 824 assert(!_json.containsKey("imports")); | 944 assert(!_json.containsKey("imports")); |
| 825 if (_value != null || _value.isEmpty) { | 945 if (_value != null || _value.isEmpty) { |
| 826 _json["imports"] = _value.map((b) => b.finish()).toList(); | 946 _json["imports"] = _value.map((b) => b.finish()).toList(); |
| 827 } | 947 } |
| 828 } | 948 } |
| 829 | 949 |
| 830 void set typedefs(List<UnlinkedTypedefBuilder> _value) { | 950 void set typedefs(List<UnlinkedTypedefBuilder> _value) { |
| 951 assert(!_finished); | |
| 831 assert(!_json.containsKey("typedefs")); | 952 assert(!_json.containsKey("typedefs")); |
| 832 if (_value != null || _value.isEmpty) { | 953 if (_value != null || _value.isEmpty) { |
| 833 _json["typedefs"] = _value.map((b) => b.finish()).toList(); | 954 _json["typedefs"] = _value.map((b) => b.finish()).toList(); |
| 834 } | 955 } |
| 835 } | 956 } |
| 836 | 957 |
| 837 void set variables(List<UnlinkedVariableBuilder> _value) { | 958 void set variables(List<UnlinkedVariableBuilder> _value) { |
| 959 assert(!_finished); | |
| 838 assert(!_json.containsKey("variables")); | 960 assert(!_json.containsKey("variables")); |
| 839 if (_value != null || _value.isEmpty) { | 961 if (_value != null || _value.isEmpty) { |
| 840 _json["variables"] = _value.map((b) => b.finish()).toList(); | 962 _json["variables"] = _value.map((b) => b.finish()).toList(); |
| 841 } | 963 } |
| 842 } | 964 } |
| 843 | 965 |
| 844 void set prefixes(List<UnlinkedPrefixBuilder> _value) { | 966 void set prefixes(List<UnlinkedPrefixBuilder> _value) { |
| 967 assert(!_finished); | |
| 845 assert(!_json.containsKey("prefixes")); | 968 assert(!_json.containsKey("prefixes")); |
| 846 if (_value != null || _value.isEmpty) { | 969 if (_value != null || _value.isEmpty) { |
| 847 _json["prefixes"] = _value.map((b) => b.finish()).toList(); | 970 _json["prefixes"] = _value.map((b) => b.finish()).toList(); |
| 848 } | 971 } |
| 849 } | 972 } |
| 850 | 973 |
| 851 Map finish() => _json; | 974 Map finish() { |
| 975 assert(!_finished); | |
| 976 _finished = true; | |
| 977 return _json; | |
| 978 } | |
| 852 } | 979 } |
| 853 | 980 |
| 854 UnlinkedLibraryBuilder encodeUnlinkedLibrary(builder.BuilderContext builderConte xt, {List<UnlinkedReferenceBuilder> references, List<UnlinkedUnitBuilder> units, String name, List<UnlinkedClassBuilder> classes, List<UnlinkedEnumBuilder> enum s, List<UnlinkedExecutableBuilder> executables, List<UnlinkedExportBuilder> expo rts, List<UnlinkedImportBuilder> imports, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuilder> variables, List<UnlinkedPrefixBuilder> prefixes}) { | 981 UnlinkedLibraryBuilder encodeUnlinkedLibrary(builder.BuilderContext builderConte xt, {List<UnlinkedReferenceBuilder> references, List<UnlinkedUnitBuilder> units, String name, List<UnlinkedClassBuilder> classes, List<UnlinkedEnumBuilder> enum s, List<UnlinkedExecutableBuilder> executables, List<UnlinkedExportBuilder> expo rts, List<UnlinkedImportBuilder> imports, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuilder> variables, List<UnlinkedPrefixBuilder> prefixes}) { |
| 855 UnlinkedLibraryBuilder builder = new UnlinkedLibraryBuilder(builderContext); | 982 UnlinkedLibraryBuilder builder = new UnlinkedLibraryBuilder(builderContext); |
| 856 builder.references = references; | 983 builder.references = references; |
| 857 builder.units = units; | 984 builder.units = units; |
| 858 builder.name = name; | 985 builder.name = name; |
| 859 builder.classes = classes; | 986 builder.classes = classes; |
| 860 builder.enums = enums; | 987 builder.enums = enums; |
| 861 builder.executables = executables; | 988 builder.executables = executables; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 890 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[]; | 1017 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[]; |
| 891 UnlinkedParamKind get kind => _kind ?? UnlinkedParamKind.required; | 1018 UnlinkedParamKind get kind => _kind ?? UnlinkedParamKind.required; |
| 892 bool get isFunctionTyped => _isFunctionTyped ?? false; | 1019 bool get isFunctionTyped => _isFunctionTyped ?? false; |
| 893 bool get isInitializingFormal => _isInitializingFormal ?? false; | 1020 bool get isInitializingFormal => _isInitializingFormal ?? false; |
| 894 bool get hasImplicitType => _hasImplicitType ?? false; | 1021 bool get hasImplicitType => _hasImplicitType ?? false; |
| 895 } | 1022 } |
| 896 | 1023 |
| 897 class UnlinkedParamBuilder { | 1024 class UnlinkedParamBuilder { |
| 898 final Map _json = {}; | 1025 final Map _json = {}; |
| 899 | 1026 |
| 1027 bool _finished = false; | |
| 1028 | |
| 900 UnlinkedParamBuilder(builder.BuilderContext context); | 1029 UnlinkedParamBuilder(builder.BuilderContext context); |
| 901 | 1030 |
| 902 void set name(String _value) { | 1031 void set name(String _value) { |
| 1032 assert(!_finished); | |
| 903 assert(!_json.containsKey("name")); | 1033 assert(!_json.containsKey("name")); |
| 904 if (_value != null) { | 1034 if (_value != null) { |
| 905 _json["name"] = _value; | 1035 _json["name"] = _value; |
| 906 } | 1036 } |
| 907 } | 1037 } |
| 908 | 1038 |
| 909 void set type(UnlinkedTypeRefBuilder _value) { | 1039 void set type(UnlinkedTypeRefBuilder _value) { |
| 1040 assert(!_finished); | |
| 910 assert(!_json.containsKey("type")); | 1041 assert(!_json.containsKey("type")); |
| 911 if (_value != null) { | 1042 if (_value != null) { |
| 912 _json["type"] = _value.finish(); | 1043 _json["type"] = _value.finish(); |
| 913 } | 1044 } |
| 914 } | 1045 } |
| 915 | 1046 |
| 916 void set parameters(List<UnlinkedParamBuilder> _value) { | 1047 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 1048 assert(!_finished); | |
| 917 assert(!_json.containsKey("parameters")); | 1049 assert(!_json.containsKey("parameters")); |
| 918 if (_value != null || _value.isEmpty) { | 1050 if (_value != null || _value.isEmpty) { |
| 919 _json["parameters"] = _value.map((b) => b.finish()).toList(); | 1051 _json["parameters"] = _value.map((b) => b.finish()).toList(); |
| 920 } | 1052 } |
| 921 } | 1053 } |
| 922 | 1054 |
| 923 void set kind(UnlinkedParamKind _value) { | 1055 void set kind(UnlinkedParamKind _value) { |
| 1056 assert(!_finished); | |
| 924 assert(!_json.containsKey("kind")); | 1057 assert(!_json.containsKey("kind")); |
| 925 if (_value != null || _value == UnlinkedParamKind.required) { | 1058 if (_value != null || _value == UnlinkedParamKind.required) { |
| 926 _json["kind"] = _value.index; | 1059 _json["kind"] = _value.index; |
| 927 } | 1060 } |
| 928 } | 1061 } |
| 929 | 1062 |
| 930 void set isFunctionTyped(bool _value) { | 1063 void set isFunctionTyped(bool _value) { |
| 1064 assert(!_finished); | |
| 931 assert(!_json.containsKey("isFunctionTyped")); | 1065 assert(!_json.containsKey("isFunctionTyped")); |
| 932 if (_value != null) { | 1066 if (_value != null) { |
| 933 _json["isFunctionTyped"] = _value; | 1067 _json["isFunctionTyped"] = _value; |
| 934 } | 1068 } |
| 935 } | 1069 } |
| 936 | 1070 |
| 937 void set isInitializingFormal(bool _value) { | 1071 void set isInitializingFormal(bool _value) { |
| 1072 assert(!_finished); | |
| 938 assert(!_json.containsKey("isInitializingFormal")); | 1073 assert(!_json.containsKey("isInitializingFormal")); |
| 939 if (_value != null) { | 1074 if (_value != null) { |
| 940 _json["isInitializingFormal"] = _value; | 1075 _json["isInitializingFormal"] = _value; |
| 941 } | 1076 } |
| 942 } | 1077 } |
| 943 | 1078 |
| 944 void set hasImplicitType(bool _value) { | 1079 void set hasImplicitType(bool _value) { |
| 1080 assert(!_finished); | |
| 945 assert(!_json.containsKey("hasImplicitType")); | 1081 assert(!_json.containsKey("hasImplicitType")); |
| 946 if (_value != null) { | 1082 if (_value != null) { |
| 947 _json["hasImplicitType"] = _value; | 1083 _json["hasImplicitType"] = _value; |
| 948 } | 1084 } |
| 949 } | 1085 } |
| 950 | 1086 |
| 951 Map finish() => _json; | 1087 Map finish() { |
| 1088 assert(!_finished); | |
| 1089 _finished = true; | |
| 1090 return _json; | |
| 1091 } | |
| 952 } | 1092 } |
| 953 | 1093 |
| 954 UnlinkedParamBuilder encodeUnlinkedParam(builder.BuilderContext builderContext, {String name, UnlinkedTypeRefBuilder type, List<UnlinkedParamBuilder> parameters , UnlinkedParamKind kind, bool isFunctionTyped, bool isInitializingFormal, bool hasImplicitType}) { | 1094 UnlinkedParamBuilder encodeUnlinkedParam(builder.BuilderContext builderContext, {String name, UnlinkedTypeRefBuilder type, List<UnlinkedParamBuilder> parameters , UnlinkedParamKind kind, bool isFunctionTyped, bool isInitializingFormal, bool hasImplicitType}) { |
| 955 UnlinkedParamBuilder builder = new UnlinkedParamBuilder(builderContext); | 1095 UnlinkedParamBuilder builder = new UnlinkedParamBuilder(builderContext); |
| 956 builder.name = name; | 1096 builder.name = name; |
| 957 builder.type = type; | 1097 builder.type = type; |
| 958 builder.parameters = parameters; | 1098 builder.parameters = parameters; |
| 959 builder.kind = kind; | 1099 builder.kind = kind; |
| 960 builder.isFunctionTyped = isFunctionTyped; | 1100 builder.isFunctionTyped = isFunctionTyped; |
| 961 builder.isInitializingFormal = isInitializingFormal; | 1101 builder.isInitializingFormal = isInitializingFormal; |
| 962 builder.hasImplicitType = hasImplicitType; | 1102 builder.hasImplicitType = hasImplicitType; |
| 963 return builder; | 1103 return builder; |
| 964 } | 1104 } |
| 965 | 1105 |
| 966 class UnlinkedPrefix { | 1106 class UnlinkedPrefix { |
| 967 String _name; | 1107 String _name; |
| 968 | 1108 |
| 969 UnlinkedPrefix.fromJson(Map json) | 1109 UnlinkedPrefix.fromJson(Map json) |
| 970 : _name = json["name"]; | 1110 : _name = json["name"]; |
| 971 | 1111 |
| 972 String get name => _name ?? ''; | 1112 String get name => _name ?? ''; |
| 973 } | 1113 } |
| 974 | 1114 |
| 975 class UnlinkedPrefixBuilder { | 1115 class UnlinkedPrefixBuilder { |
| 976 final Map _json = {}; | 1116 final Map _json = {}; |
| 977 | 1117 |
| 1118 bool _finished = false; | |
| 1119 | |
| 978 UnlinkedPrefixBuilder(builder.BuilderContext context); | 1120 UnlinkedPrefixBuilder(builder.BuilderContext context); |
| 979 | 1121 |
| 980 void set name(String _value) { | 1122 void set name(String _value) { |
| 1123 assert(!_finished); | |
| 981 assert(!_json.containsKey("name")); | 1124 assert(!_json.containsKey("name")); |
| 982 if (_value != null) { | 1125 if (_value != null) { |
| 983 _json["name"] = _value; | 1126 _json["name"] = _value; |
| 984 } | 1127 } |
| 985 } | 1128 } |
| 986 | 1129 |
| 987 Map finish() => _json; | 1130 Map finish() { |
| 1131 assert(!_finished); | |
| 1132 _finished = true; | |
| 1133 return _json; | |
| 1134 } | |
| 988 } | 1135 } |
| 989 | 1136 |
| 990 UnlinkedPrefixBuilder encodeUnlinkedPrefix(builder.BuilderContext builderContext , {String name}) { | 1137 UnlinkedPrefixBuilder encodeUnlinkedPrefix(builder.BuilderContext builderContext , {String name}) { |
| 991 UnlinkedPrefixBuilder builder = new UnlinkedPrefixBuilder(builderContext); | 1138 UnlinkedPrefixBuilder builder = new UnlinkedPrefixBuilder(builderContext); |
| 992 builder.name = name; | 1139 builder.name = name; |
| 993 return builder; | 1140 return builder; |
| 994 } | 1141 } |
| 995 | 1142 |
| 996 class UnlinkedReference { | 1143 class UnlinkedReference { |
| 997 String _name; | 1144 String _name; |
| 998 int _prefix; | 1145 int _prefix; |
| 999 | 1146 |
| 1000 UnlinkedReference.fromJson(Map json) | 1147 UnlinkedReference.fromJson(Map json) |
| 1001 : _name = json["name"], | 1148 : _name = json["name"], |
| 1002 _prefix = json["prefix"]; | 1149 _prefix = json["prefix"]; |
| 1003 | 1150 |
| 1004 String get name => _name ?? ''; | 1151 String get name => _name ?? ''; |
| 1005 int get prefix => _prefix ?? 0; | 1152 int get prefix => _prefix ?? 0; |
| 1006 } | 1153 } |
| 1007 | 1154 |
| 1008 class UnlinkedReferenceBuilder { | 1155 class UnlinkedReferenceBuilder { |
| 1009 final Map _json = {}; | 1156 final Map _json = {}; |
| 1010 | 1157 |
| 1158 bool _finished = false; | |
| 1159 | |
| 1011 UnlinkedReferenceBuilder(builder.BuilderContext context); | 1160 UnlinkedReferenceBuilder(builder.BuilderContext context); |
| 1012 | 1161 |
| 1013 void set name(String _value) { | 1162 void set name(String _value) { |
| 1163 assert(!_finished); | |
| 1014 assert(!_json.containsKey("name")); | 1164 assert(!_json.containsKey("name")); |
| 1015 if (_value != null) { | 1165 if (_value != null) { |
| 1016 _json["name"] = _value; | 1166 _json["name"] = _value; |
| 1017 } | 1167 } |
| 1018 } | 1168 } |
| 1019 | 1169 |
| 1020 void set prefix(int _value) { | 1170 void set prefix(int _value) { |
| 1171 assert(!_finished); | |
| 1021 assert(!_json.containsKey("prefix")); | 1172 assert(!_json.containsKey("prefix")); |
| 1022 if (_value != null) { | 1173 if (_value != null) { |
| 1023 _json["prefix"] = _value; | 1174 _json["prefix"] = _value; |
| 1024 } | 1175 } |
| 1025 } | 1176 } |
| 1026 | 1177 |
| 1027 Map finish() => _json; | 1178 Map finish() { |
| 1179 assert(!_finished); | |
| 1180 _finished = true; | |
| 1181 return _json; | |
| 1182 } | |
| 1028 } | 1183 } |
| 1029 | 1184 |
| 1030 UnlinkedReferenceBuilder encodeUnlinkedReference(builder.BuilderContext builderC ontext, {String name, int prefix}) { | 1185 UnlinkedReferenceBuilder encodeUnlinkedReference(builder.BuilderContext builderC ontext, {String name, int prefix}) { |
| 1031 UnlinkedReferenceBuilder builder = new UnlinkedReferenceBuilder(builderContext ); | 1186 UnlinkedReferenceBuilder builder = new UnlinkedReferenceBuilder(builderContext ); |
| 1032 builder.name = name; | 1187 builder.name = name; |
| 1033 builder.prefix = prefix; | 1188 builder.prefix = prefix; |
| 1034 return builder; | 1189 return builder; |
| 1035 } | 1190 } |
| 1036 | 1191 |
| 1037 class UnlinkedTypedef { | 1192 class UnlinkedTypedef { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 1051 String get name => _name ?? ''; | 1206 String get name => _name ?? ''; |
| 1052 int get unit => _unit ?? 0; | 1207 int get unit => _unit ?? 0; |
| 1053 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink edTypeParam>[]; | 1208 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink edTypeParam>[]; |
| 1054 UnlinkedTypeRef get returnType => _returnType; | 1209 UnlinkedTypeRef get returnType => _returnType; |
| 1055 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[]; | 1210 List<UnlinkedParam> get parameters => _parameters ?? const <UnlinkedParam>[]; |
| 1056 } | 1211 } |
| 1057 | 1212 |
| 1058 class UnlinkedTypedefBuilder { | 1213 class UnlinkedTypedefBuilder { |
| 1059 final Map _json = {}; | 1214 final Map _json = {}; |
| 1060 | 1215 |
| 1216 bool _finished = false; | |
| 1217 | |
| 1061 UnlinkedTypedefBuilder(builder.BuilderContext context); | 1218 UnlinkedTypedefBuilder(builder.BuilderContext context); |
| 1062 | 1219 |
| 1063 void set name(String _value) { | 1220 void set name(String _value) { |
| 1221 assert(!_finished); | |
| 1064 assert(!_json.containsKey("name")); | 1222 assert(!_json.containsKey("name")); |
| 1065 if (_value != null) { | 1223 if (_value != null) { |
| 1066 _json["name"] = _value; | 1224 _json["name"] = _value; |
| 1067 } | 1225 } |
| 1068 } | 1226 } |
| 1069 | 1227 |
| 1070 void set unit(int _value) { | 1228 void set unit(int _value) { |
| 1229 assert(!_finished); | |
| 1071 assert(!_json.containsKey("unit")); | 1230 assert(!_json.containsKey("unit")); |
| 1072 if (_value != null) { | 1231 if (_value != null) { |
| 1073 _json["unit"] = _value; | 1232 _json["unit"] = _value; |
| 1074 } | 1233 } |
| 1075 } | 1234 } |
| 1076 | 1235 |
| 1077 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 1236 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 1237 assert(!_finished); | |
| 1078 assert(!_json.containsKey("typeParameters")); | 1238 assert(!_json.containsKey("typeParameters")); |
| 1079 if (_value != null || _value.isEmpty) { | 1239 if (_value != null || _value.isEmpty) { |
| 1080 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 1240 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 1081 } | 1241 } |
| 1082 } | 1242 } |
| 1083 | 1243 |
| 1084 void set returnType(UnlinkedTypeRefBuilder _value) { | 1244 void set returnType(UnlinkedTypeRefBuilder _value) { |
| 1245 assert(!_finished); | |
| 1085 assert(!_json.containsKey("returnType")); | 1246 assert(!_json.containsKey("returnType")); |
| 1086 if (_value != null) { | 1247 if (_value != null) { |
| 1087 _json["returnType"] = _value.finish(); | 1248 _json["returnType"] = _value.finish(); |
| 1088 } | 1249 } |
| 1089 } | 1250 } |
| 1090 | 1251 |
| 1091 void set parameters(List<UnlinkedParamBuilder> _value) { | 1252 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 1253 assert(!_finished); | |
| 1092 assert(!_json.containsKey("parameters")); | 1254 assert(!_json.containsKey("parameters")); |
| 1093 if (_value != null || _value.isEmpty) { | 1255 if (_value != null || _value.isEmpty) { |
| 1094 _json["parameters"] = _value.map((b) => b.finish()).toList(); | 1256 _json["parameters"] = _value.map((b) => b.finish()).toList(); |
| 1095 } | 1257 } |
| 1096 } | 1258 } |
| 1097 | 1259 |
| 1098 Map finish() => _json; | 1260 Map finish() { |
| 1261 assert(!_finished); | |
| 1262 _finished = true; | |
| 1263 return _json; | |
| 1264 } | |
| 1099 } | 1265 } |
| 1100 | 1266 |
| 1101 UnlinkedTypedefBuilder encodeUnlinkedTypedef(builder.BuilderContext builderConte xt, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, Unlin kedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters}) { | 1267 UnlinkedTypedefBuilder encodeUnlinkedTypedef(builder.BuilderContext builderConte xt, {String name, int unit, List<UnlinkedTypeParamBuilder> typeParameters, Unlin kedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters}) { |
| 1102 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); | 1268 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); |
| 1103 builder.name = name; | 1269 builder.name = name; |
| 1104 builder.unit = unit; | 1270 builder.unit = unit; |
| 1105 builder.typeParameters = typeParameters; | 1271 builder.typeParameters = typeParameters; |
| 1106 builder.returnType = returnType; | 1272 builder.returnType = returnType; |
| 1107 builder.parameters = parameters; | 1273 builder.parameters = parameters; |
| 1108 return builder; | 1274 return builder; |
| 1109 } | 1275 } |
| 1110 | 1276 |
| 1111 class UnlinkedTypeParam { | 1277 class UnlinkedTypeParam { |
| 1112 String _name; | 1278 String _name; |
| 1113 UnlinkedTypeRef _bound; | 1279 UnlinkedTypeRef _bound; |
| 1114 | 1280 |
| 1115 UnlinkedTypeParam.fromJson(Map json) | 1281 UnlinkedTypeParam.fromJson(Map json) |
| 1116 : _name = json["name"], | 1282 : _name = json["name"], |
| 1117 _bound = json["bound"] == null ? null : new UnlinkedTypeRef.fromJson(json[ "bound"]); | 1283 _bound = json["bound"] == null ? null : new UnlinkedTypeRef.fromJson(json[ "bound"]); |
| 1118 | 1284 |
| 1119 String get name => _name ?? ''; | 1285 String get name => _name ?? ''; |
| 1120 UnlinkedTypeRef get bound => _bound; | 1286 UnlinkedTypeRef get bound => _bound; |
| 1121 } | 1287 } |
| 1122 | 1288 |
| 1123 class UnlinkedTypeParamBuilder { | 1289 class UnlinkedTypeParamBuilder { |
| 1124 final Map _json = {}; | 1290 final Map _json = {}; |
| 1125 | 1291 |
| 1292 bool _finished = false; | |
| 1293 | |
| 1126 UnlinkedTypeParamBuilder(builder.BuilderContext context); | 1294 UnlinkedTypeParamBuilder(builder.BuilderContext context); |
| 1127 | 1295 |
| 1128 void set name(String _value) { | 1296 void set name(String _value) { |
| 1297 assert(!_finished); | |
| 1129 assert(!_json.containsKey("name")); | 1298 assert(!_json.containsKey("name")); |
| 1130 if (_value != null) { | 1299 if (_value != null) { |
| 1131 _json["name"] = _value; | 1300 _json["name"] = _value; |
| 1132 } | 1301 } |
| 1133 } | 1302 } |
| 1134 | 1303 |
| 1135 void set bound(UnlinkedTypeRefBuilder _value) { | 1304 void set bound(UnlinkedTypeRefBuilder _value) { |
| 1305 assert(!_finished); | |
| 1136 assert(!_json.containsKey("bound")); | 1306 assert(!_json.containsKey("bound")); |
| 1137 if (_value != null) { | 1307 if (_value != null) { |
| 1138 _json["bound"] = _value.finish(); | 1308 _json["bound"] = _value.finish(); |
| 1139 } | 1309 } |
| 1140 } | 1310 } |
| 1141 | 1311 |
| 1142 Map finish() => _json; | 1312 Map finish() { |
| 1313 assert(!_finished); | |
| 1314 _finished = true; | |
| 1315 return _json; | |
| 1316 } | |
| 1143 } | 1317 } |
| 1144 | 1318 |
| 1145 UnlinkedTypeParamBuilder encodeUnlinkedTypeParam(builder.BuilderContext builderC ontext, {String name, UnlinkedTypeRefBuilder bound}) { | 1319 UnlinkedTypeParamBuilder encodeUnlinkedTypeParam(builder.BuilderContext builderC ontext, {String name, UnlinkedTypeRefBuilder bound}) { |
| 1146 UnlinkedTypeParamBuilder builder = new UnlinkedTypeParamBuilder(builderContext ); | 1320 UnlinkedTypeParamBuilder builder = new UnlinkedTypeParamBuilder(builderContext ); |
| 1147 builder.name = name; | 1321 builder.name = name; |
| 1148 builder.bound = bound; | 1322 builder.bound = bound; |
| 1149 return builder; | 1323 return builder; |
| 1150 } | 1324 } |
| 1151 | 1325 |
| 1152 class UnlinkedTypeRef { | 1326 class UnlinkedTypeRef { |
| 1153 int _reference; | 1327 int _reference; |
| 1154 int _paramReference; | 1328 int _paramReference; |
| 1155 List<UnlinkedTypeRef> _typeArguments; | 1329 List<UnlinkedTypeRef> _typeArguments; |
| 1156 | 1330 |
| 1157 UnlinkedTypeRef.fromJson(Map json) | 1331 UnlinkedTypeRef.fromJson(Map json) |
| 1158 : _reference = json["reference"], | 1332 : _reference = json["reference"], |
| 1159 _paramReference = json["paramReference"], | 1333 _paramReference = json["paramReference"], |
| 1160 _typeArguments = json["typeArguments"]?.map((x) => new UnlinkedTypeRef.fro mJson(x))?.toList(); | 1334 _typeArguments = json["typeArguments"]?.map((x) => new UnlinkedTypeRef.fro mJson(x))?.toList(); |
| 1161 | 1335 |
| 1162 int get reference => _reference ?? 0; | 1336 int get reference => _reference ?? 0; |
| 1163 int get paramReference => _paramReference ?? 0; | 1337 int get paramReference => _paramReference ?? 0; |
| 1164 List<UnlinkedTypeRef> get typeArguments => _typeArguments ?? const <UnlinkedTy peRef>[]; | 1338 List<UnlinkedTypeRef> get typeArguments => _typeArguments ?? const <UnlinkedTy peRef>[]; |
| 1165 } | 1339 } |
| 1166 | 1340 |
| 1167 class UnlinkedTypeRefBuilder { | 1341 class UnlinkedTypeRefBuilder { |
| 1168 final Map _json = {}; | 1342 final Map _json = {}; |
| 1169 | 1343 |
| 1344 bool _finished = false; | |
| 1345 | |
| 1170 UnlinkedTypeRefBuilder(builder.BuilderContext context); | 1346 UnlinkedTypeRefBuilder(builder.BuilderContext context); |
| 1171 | 1347 |
| 1172 void set reference(int _value) { | 1348 void set reference(int _value) { |
| 1349 assert(!_finished); | |
| 1173 assert(!_json.containsKey("reference")); | 1350 assert(!_json.containsKey("reference")); |
| 1174 if (_value != null) { | 1351 if (_value != null) { |
| 1175 _json["reference"] = _value; | 1352 _json["reference"] = _value; |
| 1176 } | 1353 } |
| 1177 } | 1354 } |
| 1178 | 1355 |
| 1179 void set paramReference(int _value) { | 1356 void set paramReference(int _value) { |
| 1357 assert(!_finished); | |
| 1180 assert(!_json.containsKey("paramReference")); | 1358 assert(!_json.containsKey("paramReference")); |
| 1181 if (_value != null) { | 1359 if (_value != null) { |
| 1182 _json["paramReference"] = _value; | 1360 _json["paramReference"] = _value; |
| 1183 } | 1361 } |
| 1184 } | 1362 } |
| 1185 | 1363 |
| 1186 void set typeArguments(List<UnlinkedTypeRefBuilder> _value) { | 1364 void set typeArguments(List<UnlinkedTypeRefBuilder> _value) { |
| 1365 assert(!_finished); | |
| 1187 assert(!_json.containsKey("typeArguments")); | 1366 assert(!_json.containsKey("typeArguments")); |
| 1188 if (_value != null || _value.isEmpty) { | 1367 if (_value != null || _value.isEmpty) { |
| 1189 _json["typeArguments"] = _value.map((b) => b.finish()).toList(); | 1368 _json["typeArguments"] = _value.map((b) => b.finish()).toList(); |
| 1190 } | 1369 } |
| 1191 } | 1370 } |
| 1192 | 1371 |
| 1193 Map finish() => _json; | 1372 Map finish() { |
| 1373 assert(!_finished); | |
| 1374 _finished = true; | |
| 1375 return _json; | |
| 1376 } | |
| 1194 } | 1377 } |
| 1195 | 1378 |
| 1196 UnlinkedTypeRefBuilder encodeUnlinkedTypeRef(builder.BuilderContext builderConte xt, {int reference, int paramReference, List<UnlinkedTypeRefBuilder> typeArgumen ts}) { | 1379 UnlinkedTypeRefBuilder encodeUnlinkedTypeRef(builder.BuilderContext builderConte xt, {int reference, int paramReference, List<UnlinkedTypeRefBuilder> typeArgumen ts}) { |
| 1197 UnlinkedTypeRefBuilder builder = new UnlinkedTypeRefBuilder(builderContext); | 1380 UnlinkedTypeRefBuilder builder = new UnlinkedTypeRefBuilder(builderContext); |
| 1198 builder.reference = reference; | 1381 builder.reference = reference; |
| 1199 builder.paramReference = paramReference; | 1382 builder.paramReference = paramReference; |
| 1200 builder.typeArguments = typeArguments; | 1383 builder.typeArguments = typeArguments; |
| 1201 return builder; | 1384 return builder; |
| 1202 } | 1385 } |
| 1203 | 1386 |
| 1204 class UnlinkedUnit { | 1387 class UnlinkedUnit { |
| 1205 String _uri; | 1388 String _uri; |
| 1206 | 1389 |
| 1207 UnlinkedUnit.fromJson(Map json) | 1390 UnlinkedUnit.fromJson(Map json) |
| 1208 : _uri = json["uri"]; | 1391 : _uri = json["uri"]; |
| 1209 | 1392 |
| 1210 String get uri => _uri ?? ''; | 1393 String get uri => _uri ?? ''; |
| 1211 } | 1394 } |
| 1212 | 1395 |
| 1213 class UnlinkedUnitBuilder { | 1396 class UnlinkedUnitBuilder { |
| 1214 final Map _json = {}; | 1397 final Map _json = {}; |
| 1215 | 1398 |
| 1399 bool _finished = false; | |
| 1400 | |
| 1216 UnlinkedUnitBuilder(builder.BuilderContext context); | 1401 UnlinkedUnitBuilder(builder.BuilderContext context); |
| 1217 | 1402 |
| 1218 void set uri(String _value) { | 1403 void set uri(String _value) { |
| 1404 assert(!_finished); | |
| 1219 assert(!_json.containsKey("uri")); | 1405 assert(!_json.containsKey("uri")); |
| 1220 if (_value != null) { | 1406 if (_value != null) { |
| 1221 _json["uri"] = _value; | 1407 _json["uri"] = _value; |
| 1222 } | 1408 } |
| 1223 } | 1409 } |
| 1224 | 1410 |
| 1225 Map finish() => _json; | 1411 Map finish() { |
| 1412 assert(!_finished); | |
| 1413 _finished = true; | |
| 1414 return _json; | |
| 1415 } | |
| 1226 } | 1416 } |
| 1227 | 1417 |
| 1228 UnlinkedUnitBuilder encodeUnlinkedUnit(builder.BuilderContext builderContext, {S tring uri}) { | 1418 UnlinkedUnitBuilder encodeUnlinkedUnit(builder.BuilderContext builderContext, {S tring uri}) { |
| 1229 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); | 1419 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); |
| 1230 builder.uri = uri; | 1420 builder.uri = uri; |
| 1231 return builder; | 1421 return builder; |
| 1232 } | 1422 } |
| 1233 | 1423 |
| 1234 class UnlinkedVariable { | 1424 class UnlinkedVariable { |
| 1235 String _name; | 1425 String _name; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1254 UnlinkedTypeRef get type => _type; | 1444 UnlinkedTypeRef get type => _type; |
| 1255 bool get isStatic => _isStatic ?? false; | 1445 bool get isStatic => _isStatic ?? false; |
| 1256 bool get isFinal => _isFinal ?? false; | 1446 bool get isFinal => _isFinal ?? false; |
| 1257 bool get isConst => _isConst ?? false; | 1447 bool get isConst => _isConst ?? false; |
| 1258 bool get hasImplicitType => _hasImplicitType ?? false; | 1448 bool get hasImplicitType => _hasImplicitType ?? false; |
| 1259 } | 1449 } |
| 1260 | 1450 |
| 1261 class UnlinkedVariableBuilder { | 1451 class UnlinkedVariableBuilder { |
| 1262 final Map _json = {}; | 1452 final Map _json = {}; |
| 1263 | 1453 |
| 1454 bool _finished = false; | |
| 1455 | |
| 1264 UnlinkedVariableBuilder(builder.BuilderContext context); | 1456 UnlinkedVariableBuilder(builder.BuilderContext context); |
| 1265 | 1457 |
| 1266 void set name(String _value) { | 1458 void set name(String _value) { |
| 1459 assert(!_finished); | |
| 1267 assert(!_json.containsKey("name")); | 1460 assert(!_json.containsKey("name")); |
| 1268 if (_value != null) { | 1461 if (_value != null) { |
| 1269 _json["name"] = _value; | 1462 _json["name"] = _value; |
| 1270 } | 1463 } |
| 1271 } | 1464 } |
| 1272 | 1465 |
| 1273 void set unit(int _value) { | 1466 void set unit(int _value) { |
| 1467 assert(!_finished); | |
| 1274 assert(!_json.containsKey("unit")); | 1468 assert(!_json.containsKey("unit")); |
| 1275 if (_value != null) { | 1469 if (_value != null) { |
| 1276 _json["unit"] = _value; | 1470 _json["unit"] = _value; |
| 1277 } | 1471 } |
| 1278 } | 1472 } |
| 1279 | 1473 |
| 1280 void set type(UnlinkedTypeRefBuilder _value) { | 1474 void set type(UnlinkedTypeRefBuilder _value) { |
| 1475 assert(!_finished); | |
| 1281 assert(!_json.containsKey("type")); | 1476 assert(!_json.containsKey("type")); |
| 1282 if (_value != null) { | 1477 if (_value != null) { |
| 1283 _json["type"] = _value.finish(); | 1478 _json["type"] = _value.finish(); |
| 1284 } | 1479 } |
| 1285 } | 1480 } |
| 1286 | 1481 |
| 1287 void set isStatic(bool _value) { | 1482 void set isStatic(bool _value) { |
| 1483 assert(!_finished); | |
| 1288 assert(!_json.containsKey("isStatic")); | 1484 assert(!_json.containsKey("isStatic")); |
| 1289 if (_value != null) { | 1485 if (_value != null) { |
| 1290 _json["isStatic"] = _value; | 1486 _json["isStatic"] = _value; |
| 1291 } | 1487 } |
| 1292 } | 1488 } |
| 1293 | 1489 |
| 1294 void set isFinal(bool _value) { | 1490 void set isFinal(bool _value) { |
| 1491 assert(!_finished); | |
| 1295 assert(!_json.containsKey("isFinal")); | 1492 assert(!_json.containsKey("isFinal")); |
| 1296 if (_value != null) { | 1493 if (_value != null) { |
| 1297 _json["isFinal"] = _value; | 1494 _json["isFinal"] = _value; |
| 1298 } | 1495 } |
| 1299 } | 1496 } |
| 1300 | 1497 |
| 1301 void set isConst(bool _value) { | 1498 void set isConst(bool _value) { |
| 1499 assert(!_finished); | |
| 1302 assert(!_json.containsKey("isConst")); | 1500 assert(!_json.containsKey("isConst")); |
| 1303 if (_value != null) { | 1501 if (_value != null) { |
| 1304 _json["isConst"] = _value; | 1502 _json["isConst"] = _value; |
| 1305 } | 1503 } |
| 1306 } | 1504 } |
| 1307 | 1505 |
| 1308 void set hasImplicitType(bool _value) { | 1506 void set hasImplicitType(bool _value) { |
| 1507 assert(!_finished); | |
| 1309 assert(!_json.containsKey("hasImplicitType")); | 1508 assert(!_json.containsKey("hasImplicitType")); |
| 1310 if (_value != null) { | 1509 if (_value != null) { |
| 1311 _json["hasImplicitType"] = _value; | 1510 _json["hasImplicitType"] = _value; |
| 1312 } | 1511 } |
| 1313 } | 1512 } |
| 1314 | 1513 |
| 1315 Map finish() => _json; | 1514 Map finish() { |
| 1515 assert(!_finished); | |
| 1516 _finished = true; | |
| 1517 return _json; | |
| 1518 } | |
| 1316 } | 1519 } |
| 1317 | 1520 |
| 1318 UnlinkedVariableBuilder encodeUnlinkedVariable(builder.BuilderContext builderCon text, {String name, int unit, UnlinkedTypeRefBuilder type, bool isStatic, bool i sFinal, bool isConst, bool hasImplicitType}) { | 1521 UnlinkedVariableBuilder encodeUnlinkedVariable(builder.BuilderContext builderCon text, {String name, int unit, UnlinkedTypeRefBuilder type, bool isStatic, bool i sFinal, bool isConst, bool hasImplicitType}) { |
| 1319 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); | 1522 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); |
| 1320 builder.name = name; | 1523 builder.name = name; |
| 1321 builder.unit = unit; | 1524 builder.unit = unit; |
| 1322 builder.type = type; | 1525 builder.type = type; |
| 1323 builder.isStatic = isStatic; | 1526 builder.isStatic = isStatic; |
| 1324 builder.isFinal = isFinal; | 1527 builder.isFinal = isFinal; |
| 1325 builder.isConst = isConst; | 1528 builder.isConst = isConst; |
| 1326 builder.hasImplicitType = hasImplicitType; | 1529 builder.hasImplicitType = hasImplicitType; |
| 1327 return builder; | 1530 return builder; |
| 1328 } | 1531 } |
| 1329 | 1532 |
| OLD | NEW |