@Override
public MapType parse(ParserState input) throws ParseException {
ExpectationResult result = Parsers.expect("map").parse(input);
if (Parsers.nullOrUnexpected(result)) {
return null;
}
Parser<KeyValue<ConjureType, ConjureType>> kv = Parsers.liberalBetween(
"<",
new KeyValueParser<>(
Parsers.whitespace(TypeParser.INSTANCE),
Parsers.whitespace(Parsers.expect(",")),
Parsers.whitespace(TypeParser.INSTANCE)),
">");
KeyValue<ConjureType, ConjureType> types = kv.parse(input);
ConjureMetrics.incrementCounter(MapType.class);
return MapType.of(types.getKey(), types.getValue());
}
}