This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR implements a multimap for storing the leading, dangling, and trailing comments for nodes. An implementation using a general-purpose implementation would use a multimaps for the leading, trailing, and dangling comments and each multimap would allocate a `Vec` for every node with a comment. This purpose-built multimap uses a shared `Vec` to store all comments where this is possible (99.99% of comments) and only allocates node specific `Vec`s if necessary. The idea behind the implementation is that comments should maintain the same order as in the source document. That means: * All comments for a node are inserted at "the same" time (one at a time, but all together) * It first inserts the leading, then dangling, and finally, a node's trailing comments.
- Loading branch information