private List<JmespathExpression> parseList(TokenType closing) {
        List<JmespathExpression> nodes = new ArrayList<>();

        while (iterator.peek().type != closing) {
            nodes.add(expression(0));
            // Skip commas.
            if (iterator.peek().type == TokenType.COMMA) {
                iterator.expect(TokenType.COMMA);
                if (iterator.peek().type == closing) {
                    throw iterator.syntax("Invalid token after ',': " + iterator.peek());
                }
            }
        }

        iterator.expect(closing);
        return nodes;
    }
Tokens that can follow led tokens.
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/Parser.java