public static HashMap<String, Object> parseMap(StringBuffer buf, int[] idx) {
		idx[0]++;
		HashMap<String, Object> into = new HashMap<String, Object>();
		while (true) {
			skipSpace(buf, idx);
			if (idx[0] >= buf.length()) {
				System.err.println("Unexpected end");
				return into;
			}
			if (buf.charAt(idx[0]) == '}') {
				idx[0]++;
				return into; // Done
			}
			if (buf.charAt(idx[0]) == ',') {
				idx[0]++;
				continue; // skip commas, don't check for errors
			}

			// Should have a string key
			String key = (String) parseObject(buf, idx);
			// Should have colon
			skipSpace(buf, idx);
			assert (buf.charAt(idx[0]) == ':');
			idx[0]++;
			skipSpace(buf, idx);
			into.put(key, parseObject(buf, idx));
		}
	}