Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: pkg/servicec/lib/stack.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/servicec/lib/scanner.dart ('k') | pkg/servicec/lib/targets.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/servicec/lib/stack.dart
diff --git a/pkg/servicec/lib/stack.dart b/pkg/servicec/lib/stack.dart
deleted file mode 100644
index 78b3ab9431b03938bd5c3c5443dd164a9d347b2d..0000000000000000000000000000000000000000
--- a/pkg/servicec/lib/stack.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'node.dart' show
- Node;
-
-class NodeStack {
- List<Node> data = <Node>[];
-
- int get size => data.length;
-
- // Stack interface.
- void pushNode(Node node) {
- data.add(node);
- }
-
- Node popNode() {
- return data.removeLast();
- }
-
- /// Returns the top of the stack or [null] if the stack is empty.
- Node topNode() {
- return data.isNotEmpty ? data.last : null;
- }
-}
-
-class Popper<T extends Node> {
- NodeStack stack;
- Popper(this.stack);
-
- T popNodeIfMatching() {
- return (stack.topNode() is T) ? stack.popNode() : null;
- }
-
- List<T> popNodesWhileMatching() {
- List<T> result = <T>[];
- while (stack.topNode() is T) {
- result.add(stack.popNode());
- }
- return result;
- }
-
- List<T> popNodes(int count) {
- List<T> result = new List<T>(count);
- assert(count <= stack.data.length);
- int oldLength = stack.data.length;
- int newLength = oldLength - count;
- for (int i = newLength; i < oldLength; ++i) {
- result[i - newLength] = stack.data[i];
- }
- stack.data.length = newLength;
- return result;
- }
-}
« no previous file with comments | « pkg/servicec/lib/scanner.dart ('k') | pkg/servicec/lib/targets.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698