def many_nodes(
    lexer: Lexer,
    open_kind: TokenKind,
    parse_fn: Callable[[Lexer], Node],
    close_kind: TokenKind,
) -> List[Node]:
    """Fetch matching nodes, at least one.

    Returns a non-empty list of parse nodes, determined by the `parse_fn`.
    This list begins with a lex token of `open_kind` and ends with a lex token of
    `close_kind`. Advances the parser to the next lex token after the closing token.
    """
    expect_token(lexer, open_kind)
    nodes = [parse_fn(lexer)]
    append = nodes.append
    while not expect_optional_token(lexer, close_kind):
        append(parse_fn(lexer))
    return nodes
def many_nodes ( lexer : Lexer , open_kind : TokenKind , parse_fn : Callable [ [ Lexer ] , Node ] , close_kind : TokenKind , ) -> List [ Node ] : expect_token ( lexer , open_kind ) nodes = [ parse_fn ( lexer ) ] append = nodes . append while not expect_optional_token ( lexer , close_kind ) : append ( parse_fn ( lexer ) ) return nodes
Fetch matching nodes, at least one.

    Returns a non-empty list of parse nodes, determined by the `parse_fn`.
    This list begins with a lex token of `open_kind` and ends with a lex token of
    `close_kind`. Advances the parser to the next lex token after the closing token.