private static String consumeInside(SimpleParser parser, char c) {
        parser.skip(); // skip the opening character.
        int start = parser.position();

        while (!parser.eof()) {
            if (parser.peek() == c) {
                String result = parser.sliceFrom(start);
                parser.skip();
                parser.ws();
                return result;
            }
            parser.skip();
        }

        throw parser.syntax("Expected " + c + " to close " + parser.sliceFrom(start));
    }
Filter out unnecessary identity selectors when creating the finalized AST to evaluate selectors.
smithy-model/src/main/java/software/amazon/smithy/model/selector/SelectorParser.java