in src/js/object-mona-parser/object-parser-common.js [26:49]
function parseAttributeTypeReferenceSection(allowUnderlyingType) {
return mona.sequence(function(s) {
const typeReferenceSection = s(mona.trimLeft(mona.text(mona.or(mona.alphanum(), mona.string('_')), {min: 1})));
const protocolSection = s(mona.maybe(mona.between(mona.string('<'), mona.string('>'), mona.text(mona.alphanum(), {min: 1}))));
const genericsSection = s(mona.maybe(mona.between(mona.string('<'), mona.string('>'), mona.split(parseAttributeTypeReferenceGenericSection(), mona.string(',')))));
const underlyingType = !allowUnderlyingType ? null :
s(mona.maybe(mona.between(mona.string('('),
mona.string(')'),
mona.text(mona.or(mona.alphanum(), mona.string('_'))))));
const suffixSpaceSection = s(mona.maybe(mona.spaces()));
const typeReference = typeReferenceFromParsedDefinition(typeReferenceSection, genericsSection, protocolSection);
const parsedAttributeTypeReferenceSection = {
typeReference: typeReference,
typeName: typeReferenceSection,
underlyingType: underlyingType,
conformingProtocol: protocolSection,
suffixSpaces: suffixSpaceSection != null ? suffixSpaceSection : '',
referencedGenericTypes: genericsSection != null ? genericsSection.map(g => g.parsedAttributeType) : []
};
return mona.value(parsedAttributeTypeReferenceSection);
});
}