// Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// 	void accept(Pinto p, Stack s);
// 
// 	default void accept(Pinto p, Table t) {
// 			List<Stack> inputs = t.takeTop();
// 			for(int i = 0; i < inputs.size(); i++) {
// 				accept(p, inputs.get(i));
// 			}
// 			t.insertAtTop(inputs);
// 	}
// }
// 
// Path: src/main/java/tech/pinto/Pinto.java
// public static class Stack extends LinkedList<Column<?>> {
// 	private static final long serialVersionUID = 1L;
// 
// 	public Stack() {
// 		super();
// 	}
// 
// 	public Stack(Collection<? extends Column<?>> c) {
// 		super(c);
// 	}
// 		
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.Stack;

			}

			// don't count colons of commas if anything's open 
			if(Arrays.stream(open).sum() > 0) { 
				h[position].append(header.charAt(i));
			} else {
				if(header.charAt(i) == ':') {
					position = 1;
				} else if(header.charAt(i) == ',') {
					this.headers.add(new Header(pinto, dependencies,
							h[0].toString(),h[1].length() == 0 ? Optional.empty() : Optional.of(h[1].toString())));
					h = new StringBuilder[] {new StringBuilder(), new StringBuilder()};
					Arrays.setAll(open, x -> 0);
					position = 0;
				} else {
					 h[position].append(header.charAt(i));
				}
			}
		}
		if(Arrays.stream(open).sum() == 0) { 
			this.headers.add(new Header(pinto, dependencies,
					h[0].toString(),h[1].length() == 0 ? Optional.empty() : Optional.of(h[1].toString())));
		} else {
			String unmatched = IntStream.range(0, 4).mapToObj(i -> open[i] == 0 ? "" : new String[]{"\"","$","{","["}[i])
					.filter(s -> !s.equals("")).collect(Collectors.joining(","));
			throw new IllegalArgumentException("Unmatched \"" + unmatched + "\" in header literal: \"[" + header + "]\"");
		}
	}

	@Override

// Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// 	void accept(Pinto p, Stack s);
// 
// 	default void accept(Pinto p, Table t) {
// 			List<Stack> inputs = t.takeTop();
// 			for(int i = 0; i < inputs.size(); i++) {
// 				accept(p, inputs.get(i));
// 			}
// 			t.insertAtTop(inputs);
// 	}
// }
// 
// Path: src/main/java/tech/pinto/Pinto.java
// public static class Stack extends LinkedList<Column<?>> {
// 	private static final long serialVersionUID = 1L;
// 
// 	public Stack() {
// 		super();
// 	}
// 
// 	public Stack(Collection<? extends Column<?>> c) {
// 		super(c);
// 	}
// 		
// }


// Path: src/main/java/tech/pinto/HeaderLiteral.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.Stack;

			}

			// don't count colons of commas if anything's open 
			if(Arrays.stream(open).sum() > 0) { 
				h[position].append(header.charAt(i));
			} else {
				if(header.charAt(i) == ':') {
					position = 1;
				} else if(header.charAt(i) == ',') {
					this.headers.add(new Header(pinto, dependencies,
							h[0].toString(),h[1].length() == 0 ? Optional.empty() : Optional.of(h[1].toString())));
					h = new StringBuilder[] {new StringBuilder(), new StringBuilder()};
					Arrays.setAll(open, x -> 0);
					position = 0;
				} else {
					 h[position].append(header.charAt(i));
				}
			}
		}
		if(Arrays.stream(open).sum() == 0) { 
			this.headers.add(new Header(pinto, dependencies,
					h[0].toString(),h[1].length() == 0 ? Optional.empty() : Optional.of(h[1].toString())));
		} else {
			String unmatched = IntStream.range(0, 4).mapToObj(i -> open[i] == 0 ? "" : new String[]{"\"","$","{","["}[i])
					.filter(s -> !s.equals("")).collect(Collectors.joining(","));
			throw new IllegalArgumentException("Unmatched \"" + unmatched + "\" in header literal: \"[" + header + "]\"");
		}
	}

	@Override

	public void accept(Pinto pinto, Stack stack) {
