static List<Result> parseDocsAndTraitsBeforeShape(IdlModelLoader loader, boolean isParsingMember) {
        IdlInternalTokenizer tokenizer = loader.getTokenizer();
        tokenizer.skipWs();

        Result docComment = null;

        // Mark the position of where documentation comments start if on a doc comment.
        if (tokenizer.getCurrentToken() == IdlToken.DOC_COMMENT) {
            SourceLocation documentationLocation = tokenizer.getCurrentTokenLocation();
            tokenizer.skipWsAndDocs();
            docComment = parseDocComment(tokenizer, documentationLocation);
        } else {
            tokenizer.skipWsAndDocs();
        }

        // Parse traits, if any.
        tokenizer.skipWsAndDocs();
        List<Result> traits = expectAndSkipTraits(loader);
        if (docComment != null) {
            traits.add(docComment);
        }
        tokenizer.skipWsAndDocs();
        // If there's a doc comment between traits and their target member,
        // clear them so they're not prepended to a doc comment on the next
        // member shape.
        if (isParsingMember) {
            tokenizer.clearDocCommentLinesForBr();
        }

        return traits;
    }
Assumes that the tokenizer is potentially before a shape or member definition, and parses out documentation
comments and applied traits into a list of {@link Result} values that can later be turned into instances of
{@link Trait}s to apply to shapes.

@param loader IDL parser.
@return Return the parsed traits.
smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlTraitParser.java