@_with_loc<EOL>def _read_map(ctx: ReaderContext) -> lmap.Map:
reader = ctx.reader<EOL>start = reader.advance()<EOL>assert start == "<STR_LIT:{>"<EOL>d: MutableMapping[Any, Any] = {}<EOL>while True:<EOL><INDENT>if reader.peek() == "<STR_LIT:}>":<EOL><INDENT>reader.next_token()<EOL>break<EOL><DEDENT>k = _read_next(ctx)<EOL>if k is COMMENT:<EOL><INDENT>continue<EOL><DEDENT>while True:<EOL><INDENT>if reader.peek() == "<STR_LIT:}>":<EOL><INDENT>raise SyntaxError("<STR_LIT>")<EOL><DEDENT>v = _read_next(ctx)<EOL>if v is COMMENT:<EOL><INDENT>continue<EOL><DEDENT>if k in d:<EOL><INDENT>raise SyntaxError(f"<STR_LIT>")<EOL><DEDENT>break<EOL><DEDENT>d[k] = v<EOL><DEDENT>return lmap.map(d)<EOL>
Return a map from the input stream.