private static String parseSelectorPathSegment(SimpleParser parser) {
        parser.ws();
        // Handle function properties enclosed in "(" identifier ")".
        if (parser.peek() == '(') {
            parser.skip();
            String propertyName = ParserUtils.parseIdentifier(parser);
            parser.expect(')');
            return "(" + propertyName + ")";
        } else {
            return parseAttributeValue(parser);
        }
    }
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