src/basilisp/lang/reader.py
def _read_map(ctx: ReaderContext) -> lmap.Map:
    """Return a map from the input stream."""
    reader = ctx.reader
    start = reader.advance()
    assert start == "{"
    d: MutableMapping[Any, Any] = {}
    while True:
        if reader.peek() == "}":
            reader.next_token()
            break
        k = _read_next(ctx)
        if k is COMMENT:
            continue
        while True:
            if reader.peek() == "}":
                raise SyntaxError("Unexpected token '}'; expected map value")
            v = _read_next(ctx)
            if v is COMMENT:
                continue
            if k in d:
                raise SyntaxError(f"Duplicate key '{k}' in map literal")
            break
        d[k] = v

    return lmap.map(d)
def _read_map(ctx: ReaderContext) -> lmap.Map:
    reader = ctx.reader
    start = reader.advance()
    assert start == "{"
    d: MutableMapping[Any, Any] = {}
    while True:
        if reader.peek() == "}":
            reader.next_token()
            break
        k = _read_next(ctx)
        if k is COMMENT:
            continue
        while True:
            if reader.peek() == "}":
                raise SyntaxError("Unexpected token '}'; expected map value")
            v = _read_next(ctx)
            if v is COMMENT:
                continue
            if k in d:
                raise SyntaxError(f"Duplicate key '{k}' in map literal")
            break
        d[k] = v

    return lmap.map(d)
def _read_map ( ctx : ReaderContext ) -> lmap . Map : reader = ctx . reader start = reader . advance ( ) assert start == "{" d : MutableMapping [ Any , Any ] = { } while True : if reader . peek ( ) == "}" : reader . next_token ( ) break k = _read_next ( ctx ) if k is COMMENT : continue while True : if reader . peek ( ) == "}" : raise SyntaxError ( "Unexpected token '}'; expected map value" ) v = _read_next ( ctx ) if v is COMMENT : continue if k in d : raise SyntaxError ( f"Duplicate key '{k}' in map literal" ) break d [ k ] = v return lmap . map ( d )
Return a map from the input stream.
Return a map from the input stream .