// Path: src/main/java/tech/pinto/PintoSyntaxException.java
// public class PintoSyntaxException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public PintoSyntaxException() {
// 		super();
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message, Throwable cause, boolean enableSuppression,
// 			boolean writableStackTrace) {
// 		super(message, cause, enableSuppression, writableStackTrace);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message, Throwable cause) {
// 		super(message, cause);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message) {
// 		super(message);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(Throwable cause) {
// 		super(cause);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// }


import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import tech.pinto.PintoSyntaxException;

package tech.pinto.tools;



public class StringUtils {
	
	public static String parseBlock(Scanner scanner, String opening, String closing) throws PintoSyntaxException {
		StringBuilder sb = new StringBuilder();
		String next = null;
		Pattern openPattern = Pattern.compile(".*?" + opening + ".*?");
		Pattern closePattern = Pattern.compile(".*?" + closing + ".*?");
		boolean sameOpenClose = opening.equals(closing);
		int openCount = sameOpenClose ? 2 : 0;
		do {
			if (!scanner.hasNext()) {

// Path: src/main/java/tech/pinto/PintoSyntaxException.java
// public class PintoSyntaxException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public PintoSyntaxException() {
// 		super();
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message, Throwable cause, boolean enableSuppression,
// 			boolean writableStackTrace) {
// 		super(message, cause, enableSuppression, writableStackTrace);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message, Throwable cause) {
// 		super(message, cause);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(String message) {
// 		super(message);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// 	public PintoSyntaxException(Throwable cause) {
// 		super(cause);
// 		// TODO Auto-generated constructor stub
// 	}
// 
// }


// Path: src/main/java/tech/pinto/tools/StringUtils.java
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import tech.pinto.PintoSyntaxException;

package tech.pinto.tools;



public class StringUtils {
	
	public static String parseBlock(Scanner scanner, String opening, String closing) throws PintoSyntaxException {
		StringBuilder sb = new StringBuilder();
		String next = null;
		Pattern openPattern = Pattern.compile(".*?" + opening + ".*?");
		Pattern closePattern = Pattern.compile(".*?" + closing + ".*?");
		boolean sameOpenClose = opening.equals(closing);
		int openCount = sameOpenClose ? 2 : 0;
		do {
			if (!scanner.hasNext()) {

				throw new PintoSyntaxException("Missing " + closing);
