in python/moz/l10n/formats/mf2/message_parser.py [0:0]
def attributes(self) -> dict[str, str | Literal[True]]:
attributes: dict[str, str | Literal[True]] = {}
attr_end = self.pos
while self.req_space():
ch = self.char()
if ch != "@":
self.pos = attr_end
break
id = self.identifier(1)
id_end = self.pos
if id in attributes:
raise MF2ParseError(self, f"Duplicate attribute name {id}")
if self.skip_opt_space() == "=":
self.pos += 1
self.skip_opt_space()
attributes[id] = self.literal()
else:
self.pos = id_end
attributes[id] = True
attr_end = self.pos
return attributes