Revert "Doc comments: use std::unordered_map"

hash<SourcePath> isn't implemented yet, and I can't cherry-pick
a bug-free commit yet.

This reverts commit 95529f31e3bbda99111c5ce98a33484dc6e7a462.
This commit is contained in:
Robert Hensing 2024-07-15 19:33:56 +02:00
parent ac89df815d
commit 6a125e65d0
3 changed files with 4 additions and 4 deletions

View file

@ -130,7 +130,7 @@ struct Constant
typedef std::map<std::string, Value *> ValMap; typedef std::map<std::string, Value *> ValMap;
#endif #endif
typedef std::unordered_map<PosIdx, DocComment> DocCommentMap; typedef std::map<PosIdx, DocComment> DocCommentMap;
struct Env struct Env
{ {
@ -335,7 +335,7 @@ private:
* Associate source positions of certain AST nodes with their preceding doc comment, if they have one. * Associate source positions of certain AST nodes with their preceding doc comment, if they have one.
* Grouped by file. * Grouped by file.
*/ */
std::unordered_map<SourcePath, DocCommentMap> positionToDocComment; std::map<SourcePath, DocCommentMap> positionToDocComment;
LookupPath lookupPath; LookupPath lookupPath;

View file

@ -64,7 +64,7 @@ struct LexerState
/** /**
* @brief Maps some positions to a DocComment, where the comment is relevant to the location. * @brief Maps some positions to a DocComment, where the comment is relevant to the location.
*/ */
std::unordered_map<PosIdx, DocComment> & positionToDocComment; std::map<PosIdx, DocComment> & positionToDocComment;
PosTable & positions; PosTable & positions;
PosTable::Origin origin; PosTable::Origin origin;

View file

@ -48,7 +48,7 @@
namespace nix { namespace nix {
typedef std::unordered_map<PosIdx, DocComment> DocCommentMap; typedef std::map<PosIdx, DocComment> DocCommentMap;
Expr * parseExprFromBuf( Expr * parseExprFromBuf(
char * text, char * text,