in python/moz/l10n/formats/mf2/message_parser.py [0:0]
def options(self) -> dict[str, str | VariableRef]:
options: dict[str, str | VariableRef] = {}
opt_end = self.pos
while self.req_space():
ch = self.char()
if ch == "" or ch == "@" or ch == "/" or ch == "}":
self.pos = opt_end
break
id = self.identifier(0)
if id in options:
raise MF2ParseError(self, f"Duplicate option name {id}")
self.expect("=", self.skip_opt_space())
ch = self.skip_opt_space()
options[id] = self.variable() if ch == "$" else self.literal()
opt_end = self.pos
return options