Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library sourcemap.trace_graph; | |
| 6 | |
| 7 import 'dart:collection'; | |
| 8 | |
| 9 import 'package:compiler/src/io/source_information.dart'; | |
| 10 import 'package:compiler/src/io/position_information.dart'; | |
| 11 | |
| 12 import 'sourcemap_html_helper.dart'; | |
| 13 | |
| 14 class TraceGraph { | |
| 15 List<TraceStep> steps = <TraceStep>[]; | |
| 16 TraceStep entry; | |
| 17 Queue stack = new Queue(); | |
| 18 | |
| 19 void addStep(TraceStep step) { | |
| 20 steps.add(step); | |
| 21 step.stack = stack.toList(); | |
| 22 } | |
| 23 | |
| 24 void pushBranch(branch) { | |
| 25 stack.addLast(branch); | |
| 26 } | |
| 27 | |
| 28 void popBranch() { | |
| 29 stack.removeLast(); | |
| 30 } | |
| 31 } | |
| 32 | |
| 33 class TraceStep<N> { | |
|
Siggi Cherem (dart-lang)
2016/01/21 18:18:35
drop the generic? Make it directly use js.Node bel
Johnni Winther
2016/01/22 15:12:39
Removed for now.
| |
| 34 final int id; | |
| 35 final N node; | |
| 36 final Offset offset; | |
| 37 final List text; | |
| 38 final SourceLocation sourceLocation; | |
| 39 | |
| 40 TraceStep next; | |
| 41 Map<dynamic, TraceStep> branchMap; | |
| 42 | |
| 43 List stack; | |
| 44 | |
| 45 TraceStep( | |
| 46 this.id, | |
| 47 this.node, | |
| 48 this.offset, | |
| 49 this.text, | |
| 50 [this.sourceLocation]); | |
| 51 | |
| 52 String toString() => '<span style="background:${toColorCss(id)}">$id</span>'; | |
| 53 } | |
| 54 | |
| OLD | NEW |