src/basilisp/lang/reader.py
def _read_next(ctx: ReaderContext) -> LispReaderForm:  # noqa: C901
    """Read the next full form from the input stream."""
    reader = ctx.reader
    token = reader.peek()
    if token == "(":
        return _read_list(ctx)
    elif token == "[":
        return _read_vector(ctx)
    elif token == "{":
        return _read_map(ctx)
    elif begin_num_chars.match(token):
        return _read_num(ctx)
    elif whitespace_chars.match(token):
        reader.next_token()
        return _read_next(ctx)
    elif token == ":":
        return _read_kw(ctx)
    elif token == '"':
        return _read_str(ctx)
    elif token == "'":
        return _read_quoted(ctx)
    elif token == "\\":
        return _read_character(ctx)
    elif ns_name_chars.match(token):
        return _read_sym(ctx)
    elif token == "#":
        return _read_reader_macro(ctx)
    elif token == "^":
        return _read_meta(ctx)  # type: ignore
    elif token == ";":
        return _read_comment(ctx)
    elif token == "`":
        return _read_syntax_quoted(ctx)
    elif token == "~":
        return _read_unquote(ctx)
    elif token == "@":
        return _read_deref(ctx)
    elif token == "":
        return ctx.eof
    else:
        raise SyntaxError("Unexpected token '{token}'".format(token=token))
def _read_next(ctx: ReaderContext) -> LispReaderForm:  # noqa: C901
    reader = ctx.reader
    token = reader.peek()
    if token == "(":
        return _read_list(ctx)
    elif token == "[":
        return _read_vector(ctx)
    elif token == "{":
        return _read_map(ctx)
    elif begin_num_chars.match(token):
        return _read_num(ctx)
    elif whitespace_chars.match(token):
        reader.next_token()
        return _read_next(ctx)
    elif token == ":":
        return _read_kw(ctx)
    elif token == '"':
        return _read_str(ctx)
    elif token == "'":
        return _read_quoted(ctx)
    elif token == "\\":
        return _read_character(ctx)
    elif ns_name_chars.match(token):
        return _read_sym(ctx)
    elif token == "#":
        return _read_reader_macro(ctx)
    elif token == "^":
        return _read_meta(ctx)  # type: ignore
    elif token == ";":
        return _read_comment(ctx)
    elif token == "`":
        return _read_syntax_quoted(ctx)
    elif token == "~":
        return _read_unquote(ctx)
    elif token == "@":
        return _read_deref(ctx)
    elif token == "":
        return ctx.eof
    else:
        raise SyntaxError("Unexpected token '{token}'".format(token=token))
def _read_next ( ctx : ReaderContext ) -> LispReaderForm : # noqa: C901 reader = ctx . reader token = reader . peek ( ) if token == "(" : return _read_list ( ctx ) elif token == "[" : return _read_vector ( ctx ) elif token == "{" : return _read_map ( ctx ) elif begin_num_chars . match ( token ) : return _read_num ( ctx ) elif whitespace_chars . match ( token ) : reader . next_token ( ) return _read_next ( ctx ) elif token == ":" : return _read_kw ( ctx ) elif token == '"' : return _read_str ( ctx ) elif token == "'" : return _read_quoted ( ctx ) elif token == "\\" : return _read_character ( ctx ) elif ns_name_chars . match ( token ) : return _read_sym ( ctx ) elif token == "#" : return _read_reader_macro ( ctx ) elif token == "^" : return _read_meta ( ctx ) # type: ignore elif token == ";" : return _read_comment ( ctx ) elif token == "`" : return _read_syntax_quoted ( ctx ) elif token == "~" : return _read_unquote ( ctx ) elif token == "@" : return _read_deref ( ctx ) elif token == "" : return ctx . eof else : raise SyntaxError ( "Unexpected token '{token}'" . format ( token = token ) )
Read the next full form from the input stream.
Read the next full form from the input stream .