OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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 import 'node.dart' show | 5 import 'node.dart' show |
6 Node; | 6 Node; |
7 | 7 |
8 class NodeStack { | 8 class NodeStack { |
9 List<Node> data = <Node>[]; | 9 List<Node> data = <Node>[]; |
10 | 10 |
11 int get size => data.length; | 11 int get size => data.length; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 assert(count <= stack.data.length); | 46 assert(count <= stack.data.length); |
47 int oldLength = stack.data.length; | 47 int oldLength = stack.data.length; |
48 int newLength = oldLength - count; | 48 int newLength = oldLength - count; |
49 for (int i = newLength; i < oldLength; ++i) { | 49 for (int i = newLength; i < oldLength; ++i) { |
50 result[i - newLength] = stack.data[i]; | 50 result[i - newLength] = stack.data[i]; |
51 } | 51 } |
52 stack.data.length = newLength; | 52 stack.data.length = newLength; |
53 return result; | 53 return result; |
54 } | 54 } |
55 } | 55 } |
OLD | NEW |