| OLD | NEW |
| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 typedef bool IsSafeToRemoveTypeDeclarations( | 7 typedef bool IsSafeToRemoveTypeDeclarations( |
| 8 Map<ClassElement, Iterable<Element>> classMembers); | 8 Map<ClassElement, Iterable<Element>> classMembers); |
| 9 typedef void ElementCallback<E>(E element); | 9 typedef void ElementCallback<E>(E element); |
| 10 typedef void ElementPostProcessFunction( | 10 typedef void ElementPostProcessFunction( |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (topLevelElements.contains(element)) return; | 381 if (topLevelElements.contains(element)) return; |
| 382 topLevelElements.add(element); | 382 topLevelElements.add(element); |
| 383 processElement(element, elementAst); | 383 processElement(element, elementAst); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void addClass(ClassElement classElement) { | 386 void addClass(ClassElement classElement) { |
| 387 TreeElements treeElements = new TreeElementMapping(classElement); | 387 TreeElements treeElements = new TreeElementMapping(classElement); |
| 388 backend2frontend.TreePrinter treePrinter = | 388 backend2frontend.TreePrinter treePrinter = |
| 389 new backend2frontend.TreePrinter(treeElements); | 389 new backend2frontend.TreePrinter(treeElements); |
| 390 Node node = treePrinter.makeNodeForClassElement(classElement); | 390 Node node = treePrinter.makeNodeForClassElement(classElement); |
| 391 addTopLevel(classElement, new ElementAst.internal(node, treeElements)); | 391 addTopLevel(classElement, new ElementAst(node, treeElements)); |
| 392 classMembers.putIfAbsent(classElement, () => new Set()); | 392 classMembers.putIfAbsent(classElement, () => new Set()); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void newTypedefElementCallback(TypedefElement element) { | 395 void newTypedefElementCallback(TypedefElement element) { |
| 396 if (!shouldOutput(element)) return; | 396 if (!shouldOutput(element)) return; |
| 397 addTopLevel(element, new ElementAst(element)); | 397 TreeElements treeElements = new TreeElementMapping(element); |
| 398 backend2frontend.TreePrinter treePrinter = |
| 399 new backend2frontend.TreePrinter(treeElements); |
| 400 Node node = treePrinter.makeTypedef(element); |
| 401 addTopLevel(element, new ElementAst(node, treeElements)); |
| 398 } | 402 } |
| 399 | 403 |
| 400 void newClassElementCallback(ClassElement classElement) { | 404 void newClassElementCallback(ClassElement classElement) { |
| 401 if (!shouldOutput(classElement)) return; | 405 if (!shouldOutput(classElement)) return; |
| 402 addClass(classElement); | 406 addClass(classElement); |
| 403 } | 407 } |
| 404 | 408 |
| 405 void addMember(element) { | 409 void addMember(element) { |
| 406 ElementAst elementAst = parseElementAst(element); | 410 ElementAst elementAst = parseElementAst(element); |
| 407 if (element.isClassMember) { | 411 if (element.isClassMember) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 outputProvider("", "dart") | 557 outputProvider("", "dart") |
| 554 ..add(assembledCode) | 558 ..add(assembledCode) |
| 555 ..close(); | 559 ..close(); |
| 556 | 560 |
| 557 totalSize = assembledCode.length; | 561 totalSize = assembledCode.length; |
| 558 } | 562 } |
| 559 | 563 |
| 560 return assembledCode; | 564 return assembledCode; |
| 561 } | 565 } |
| 562 } | 566 } |
| OLD | NEW |