/** * Make pattern-tree tips point to same object if they are equal. */ private void fixIdentities(List<Pattern> uniq) { // >>> if not hasattr(self, 'children') if (!(this instanceof BranchPattern)) { return; } if (uniq == null) { uniq = list(set(flat())); } final List<Pattern> children = ((BranchPattern) this).getChildren(); for (int i = 0; i < children.size(); i++) { final Pattern child = children.get(i); if (!(child instanceof BranchPattern)) { assert uniq.contains(child); children.set(i, uniq.get(uniq.indexOf(child))); } else { child.fixIdentities(uniq); } } }
/** * Make pattern-tree tips point to same object if they are equal. */ private void fixIdentities(List<Pattern> uniq) { // >>> if not hasattr(self, 'children') if (!(this instanceof BranchPattern)) { return; } if (uniq == null) { uniq = list(set(flat())); } final List<Pattern> children = ((BranchPattern) this).getChildren(); for (int i = 0; i < children.size(); i++) { final Pattern child = children.get(i); if (!(child instanceof BranchPattern)) { assert uniq.contains(child); children.set(i, uniq.get(uniq.indexOf(child))); } else { child.fixIdentities(uniq); } } }
private Map<String, Object> doParse(final List<String> argv) { final List<LeafPattern> $argv = parseArgv( Tokens.withExitException(argv), list(options), optionsFirst); final Set<Pattern> patternOptions = set(pattern.flat(Option.class)); .getChildren(); u.clear(); u.addAll(set(options)); Pattern o = null; for (final Iterator<Pattern> i = u.iterator(); i.hasNext();) {
private Map<String, Object> doParse(final List<String> argv) { final List<LeafPattern> $argv = parseArgv( Tokens.withExitException(argv), list(options), optionsFirst); final Set<Pattern> patternOptions = set(pattern.flat(Option.class)); .getChildren(); u.clear(); u.addAll(set(options)); Pattern o = null; for (final Iterator<Pattern> i = u.iterator(); i.hasNext();) {