Index: petitparser/lib/src/reflection/optimize.dart |
diff --git a/petitparser/lib/src/reflection/optimize.dart b/petitparser/lib/src/reflection/optimize.dart |
deleted file mode 100644 |
index 1ae77e7e542da7a446799f1813b9181da1b64bfa..0000000000000000000000000000000000000000 |
--- a/petitparser/lib/src/reflection/optimize.dart |
+++ /dev/null |
@@ -1,31 +0,0 @@ |
-part of reflection; |
- |
-/** |
- * Returns a copy of [parser] with all settable parsers removed. |
- */ |
-Parser removeSettables(Parser parser) { |
- return transformParser(parser, (each) { |
- while (each is SettableParser) { |
- each = each.children.first; |
- } |
- return each; |
- }); |
-} |
- |
-/** |
- * Returns a copy of [parser] with all duplicates parsers collapsed. |
- */ |
-Parser removeDuplicates(Parser parser) { |
- var uniques = new Set(); |
- return transformParser(parser, (source) { |
- var target = uniques.firstWhere((each) { |
- return source != each && source.isEqualTo(each); |
- }, orElse: () => null); |
- if (target == null) { |
- uniques.add(source); |
- return source; |
- } else { |
- return target; |
- } |
- }); |
-} |